Query being "deleted"

puakenikeni

Registered User.
Local time
Today, 01:50
Joined
Jun 24, 2008
Messages
25
The control source of my subform is a query. The form runs okay (I'm having problems here and there, but I'm getting my answers!), but if I switch to design mode and then back to form mode, for some reason, it "clears" out the query. I get the error "Query must have at least one destination field". When I check the query itself, all of the SQL code is gone. I only have the "SELECT" clause. I don't believe I have anything in my code that deletes the code in the query, so I don't know why it's behaving like this.

Any suggestions?
 
One suggestion might be in the relationships. Do you get a proper display of the data when you open the form initially?

What code do you have with the "on load" or "requery" events of the main form?
 
I somewhat get a proper display of the data in the subform, but I think it's because I'm forgetting to add in the code or something. I do have something in the Form_Load event. It's:

Code:
Me.subMaster.Requery

I had tried commenting that out, and it's still the same thing.

The only other code I have is for my comboboxes, which serve as filters for the subform. This is the code I have for them (which is more or less the same):

Code:
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[PropertyClass] = '" & Me.cboPropertyClass_tab2 & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark

Me.Repaint
Me.cboProgramName_tab2.Requery
Me.cboItemClass_tab2.Requery
Me.subMaster.Requery
If Me.Dirty Then Me.Dirty = False
 

Users who are viewing this thread

Back
Top Bottom