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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Viewing subforms

Status
Not open for further replies.

bjcountry

Technical User
Mar 17, 2008
5
US
I created a main form with a tabbed folder on it. On the tabbed folder there are a number of subforms which all relate to the main form.

The main form is working properly.

I created another form which allows the user to pick which record they would like to view from either a combo box or an input box.

Now when the user either selects or types in the record they would like to view and hits enter, the main form appears correctly with the selected record. However, if there is not currently any information to populate the subforms, then the tabbed pages with the subforms just appear with a huge white box in them (i.e. none of the labels, fields, colors, or formatting of the subforms appear). I do not want this to occur. I want the subforms to appear as they were built and as they appear in the main form when I navigate to the main form without using the input/combo option.

How can I rectify this situation?

When I open the main form WITHOUT using the combo box or the input box all the subforms are perfect even if there is no information in the fields (i.e. all the labels, fonts, colors, and text boxes appear).
 
How do you open the main form after using the combo box or the input box ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I have the input box and combo box set up with a macro on an update event to open the Main Form. The WHERE statement in the macro is set so the ProductID (for example) entered or selected from the input box or combo box equals the ProductID record that opens in the Main Form.

The subforms work fine as long as there are records in the subform's record source (an underlying table). The only time I have problems is when the record source (underlying tables) of the subforms does not have any data entered.

I am working on Access 2003. Thank your for your help.
 
Sorry, I don't know how to play with macros.
 
Well when I convert the macro to VBA this is what it looks like:

Function mcrTractSearch2()
On Error GoTo mcrTractSearch2_Err

DoCmd.OpenForm "frmTracts", acNormal, "", "[TractNumber]=[Forms]![frmTractInputCombo]![cmdTractInput]", acReadOnly, acNormal
DoCmd.Close acForm, "frmTractInputCombo"


mcrTractSearch2_Exit:
Exit Function

mcrTractSearch2_Err:
MsgBox Error$
Resume mcrTractSearch2_Exit

End Function

Does this give you any more information?
 
Please note in the above code, the cmdTractInput should actually be cboTractInput (combo box not command button). Thanks.
 
Why this parameter acReadOnly ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
It was simply because I had the subforms set to Read Only... I can't believe I've been so stressed over this for days and it was so simple. Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top