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!

Form is blank on open

Status
Not open for further replies.

StrikeEagleII

Technical User
Oct 4, 2006
57
US
I have a form that uses a stored procedure for its recordsource. When the form first opens I would like it to open to a new record, so I have it set up so when the form opens and gets it's recordset, it passes a parameter to the stored procedure that causes the stored procedure to return zero records. I am using ADO command/recordset objects and then Set Me.Recordset = rst where rst is the recordset returned from the stored procedure.

On the form header, I have several unbound controls used for a filter. The detail section of the form is where all the bound controls are. The problem is when the form opens, the detail is completely blank--none of the controls are displayed All the controls on the header show fine. If I select a value from one of the combo boxes in the form header, all the control appear as I expect (but there's no code that runs to do that...they just appear).

If I modify the parameters so that the stored procedure returns records when the form opens, all is well, but like I say, I want it open to a new record, so they can either enter a new record or filter to see an existing one.

I know that if your recordset has no records when the form opens and the form.AllowAdditions = False then everything will be blank (and this seems very similar to that), but my form.allowadditions = true. I've tried setting me.DataEntry = true, no dice. Any suggestions are appreciated.
 
Run each of the queries that the form uses as its record source individually. The problem is in the queries. I solved this exact same problem yesterday. All the controls are in place in design view, you open the form and they gone.

If your query uses other queries as its source, you must open each one individually. Betcha a cookie you'll find the problem there.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top