Hi, I've tried to open a form using a button from a menu form. The button onclick property creates a SQL join (1-1) between 2 of my tables and then sets the recordsource property. The form opens fine but the record selector always shows all records whilst the form is on the 1st record but when I move to record 2 it applies the where part of my SQL statement. I've got the following sequence of events in my vba code and I wondered if anyone can suggest a solution as to why it does not work:
strSQL = SQL statement;
DoCmd.OpenForm "X", acNormal
Forms!X.RecordSource = strSQL
Forms!X.Refresh
Forms!X.fieldY.SetFocus
Bizzarrly, it works ok on other forms. I'm using access 2010 and 2007 . Anyone come across this problem? Is there another method instead of Refresh I should be using?
thanks,
ek
strSQL = SQL statement;
DoCmd.OpenForm "X", acNormal
Forms!X.RecordSource = strSQL
Forms!X.Refresh
Forms!X.fieldY.SetFocus
Bizzarrly, it works ok on other forms. I'm using access 2010 and 2007 . Anyone come across this problem? Is there another method instead of Refresh I should be using?
thanks,
ek