Form open up empty

rgreene

Registered User.
Local time
Today, 14:08
Joined
Jan 22, 2002
Messages
168
I have a form with a subform on it. My subform gets populated by a lookup. On my main form I have an unbound (cboLotIDLU) lookup field and also a text box (LotID) that shows the chosen record. When I open the form my cboLotIDLU is blank but my LotID has an ID in it so the info for that ID is displayed on my subform. I would like everything to open up blank. I've looked around and I can't see where that first record is coming from. How do I get it so everything comes up empty?
 
Do not populate the RecordSource for the form until you want it.
 
my recordsource points to a table. How do I tell it to wait until something is chosen?
 
Your form's recordsource should be a query tied with the criteria being the combo.
 
I created a qryLotID that has ADSID and LotID and I set my frmEvents (main form) recordsource to qryLotID and I get the same thing, when I open the form the first record is shown.
 
Didn't you say that it was your SUBFORM that was showing data and not your main form?
 
Yes the info from my chosen LotID shows on the subform. I choose which LotID I want on the main form.

When I open the main form (w/subform) there is a LotID displayed in my textbox so there are events displayed on the subform.
 
That's the key, if you don't want records in the subform when you open it, make sure to clear the textbox.
 
so on my LotID on the main form on open LotID=null?
 
I get

You can't assign a value to this object when I set Me.LotID = Null
 
Same message.

I've attached the DB. it's the frmEvents that I'm working on

I thought that would be easier then me trying to explain it especially since as you can see I'm not real strong in access.

I appreciate your help.

Rick
 

Attachments

My point was to leave the RecordSource empty and only populate it when you are ready to display something.
 
If I remove the recordSource form the form I get the error
Object variable or With block variable not set
 
I've taken a look at the form and noticed that you really don't need the main form to be bound. You can use the combo boxes to have additional columns which could update your text box if you need it. Your subform can actually be the main form as the other controls could just be unbound and therefore you wouldn't need the recordsource before selecting the first, or second, combo.
 

Users who are viewing this thread

Back
Top Bottom