Requery a subform syntax

mike2000

Registered User.
Local time
Today, 22:31
Joined
Mar 3, 2003
Messages
15
I wonder if someone could spare me a moment to help me with a syntax ( i think) error. I have a text box on a subform, which it's after update event will requery a subform on the same form.
The main form is called Orders the subform is called Order details. The data that has been entered in the text box is displayed in the subform. I have put a button that requery's fine, but i would like it to be automatically updated.


Me.Forms![Orders].Forms![Order details].Requery


Thank you.
 
Try

Me![Order details].Requery

Don't use spaces in names, it will screwup eventually your sql syntax and makes coding more difficult.

Use OrderDetails when designing instead of Order Details.

However, it's too late for this form.

The common synatx method for VB and VBA is to use a prefix on all objects so that one knows instantly the character of an object, that is,

frmOrderDetails is a form
sfrmOrderDetails is a subform
ssfrmOrderDetails is a subsubform
txtOrderDetails is a text box
cboOrderDetails is a combobox
chkOrderDetails is a checkbox
lblOrderDetails is a label
etc.

Check you reference materials for the common prefixes. Days later you code will immediately mean something to you.
 
still notworking

Thanks for the reply, but its still coming up with the same error.
Do i requery the subform name or the query it is based on?
 
The subform.

Try

Forms![Orders]![Order details].Requery
 

Users who are viewing this thread

Back
Top Bottom