Take the 2-minute tour ×

I want to change the SQL of a split form in Ms Access

Dim db As Database
Dim query As QueryDef
Set db = CurrentDb
Set query = db.QueryDefs("MyQuery")

Me.query = query.SQL

Now the operation Me.query = query.SQL works, I have checked it but it simply does not refresh the results.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I think that you mean to set the recordsource:

Me.recordsource = query.SQL

As an aside, I would be cautious about using object names for variable names, query is not a good name for a variable.

share|improve this answer
I tried that before, but there was no change. But thanks, generally you are right, I will change it to requery in the question. –  John Frost Aug 27 '12 at 12:24
OK, so your solution was right after all, there was a problem with using a split form in ms access. Thanks! –  John Frost Aug 29 '12 at 7:23

Your Answer


