Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to populate form from query

Status
Not open for further replies.

tortelvis

IS-IT--Management
Feb 13, 2001
16
US
I have a form, where a user can enter a date range and click 'go'. This runs a sequence of query's that ultimately gives 1 record with 4 variables. (right now in a make table query)

My question is - how do i get this record to then display on the form after its done running? If i add a subform with the results table - the query blows up because its 'locked' in the form.

Thanks,

Tort
 
Try this in your code, it should stop the locking problem:

Me!YourSubFormName.Form.RecordSource= ""
Docmd.Setwarnings False
Docmd.OpenQuery "YourMakeTableQuery"
Docmd.Setwarnings True
Me!SubFormName.Form.RecordSource= "OriginalRecordSource"
 
Worked like a charm! thanks....

One question... the Me! - what does that indicate?
Or can it be anything as long as its consistent.

-Tort
 
In this case the Me keyword is telling Access that the subform you are referencing is on the current form.

For a better explanation search for help on Me and Form Object.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top