How do I set default values for a field in a subform in VBA?

thrainpa

Registered User.
Local time
Today, 23:08
Joined
Dec 1, 2011
Messages
29
These subforms are driving me batty, My subform pulls information specific to an Account Number defined in:

[SubFormName].Form.FilterOn = False
[SubFormName].Form.Filter = "[Account Number] = " & AccountNumber & ""
[SubFormName].Form.FilterOn = True
[SubFormName].Form.Refresh

The filter works perfect and I can add new records, BUT the Account Number field in the subform stays blank unless filled in manually.

How can I set this field to automatically fill in with the AccountNumber variable?
 
have you set the child and master properties correctly? your foreign key should then fill in the subform automatically without the need for extra coding.
 

Users who are viewing this thread

Back
Top Bottom