Full Version: Disappearing Form
UtterAccess Forums > Microsoft® Access > Access Forms
sforney123
I am running Access 2007 an .mdb file and when I select a command button on the switchboard to open another form. The form opens up everything is good you can see all the labels and fields. When I zip the file and send it to my coworker who opens up the .mdb file using Access 2003. When they select the command button on the switchboard to open another form...the form opens but you can't see any labels, comboboxes, or command buttons. The filter button is also selected but when you hit the filter button to turn off the filter everything on the form appears. The form has to be filtered though to protect my data.... below is my code.
-----------------------------------------------------------
' NewGateProfile_Click
'
'------------------------------------------------------------
Private Sub NewGateProfile_Click()
On Error GoTo NewGateProfile_Click_Err
If (Eval("IIf(Forms.Open1.[Combo1] Is Null,True,False)")) Then
Beep
MsgBox "Please select an Airport Code before proceeding", vbOKOnly, ""
End If
If (Eval("IIf(Forms.Open1.[Combo1] Is Null,True,False)")) Then
End
End If
DoCmd.OpenForm "Gate Entry", acNormal, "", "[Master].[Airport Code]=[Forms].[Open1].[Combo1]", acAdd, acNormal
NewGateProfile_Click_Exit:
Exit Sub
NewGateProfile_Click_Err:
MsgBox Error$
Resume NewGateProfile_Click_Exit
End Sub
Jeff B.
If there's no data to show, the form could potentially show no controls.
here's the data? For your copy? For their copy?
sforney123
The data is in the same database. I haven't split the data yet. Why would my entire form disappear when opened using Access 2003 except for the background color? The Form physically opens but nothing is there.
sforney123
You are right Access 2003 is recognizing there is no data to display...so how do I fix this?
Jeff B.
Not being there, I can't tell if your form tries to load all the table's records when it opens, or uses a query. If a query, can the query run successfully by itself?
sforney123
It's not a query (Though the queries I do have run fine on the switchboard) when the switch board opens and the user selects their selection data (in this case an airport code like BOS). Then they select a command button to open a new form and enter relevant data about that airport code. When the new form opens it's just blank until you turn the filter off when using Access 2003. I have the command button Set the Airport Code on the new form that opens to always equal the Airport Code on the Switchboard.
Jeff B.
Since we're not there, it's a bit difficult to guess what code is running behind those command buttons.
On alternate to using the built-in Switchboard Manager is to create your own "switchboard". You can create a new form, add command buttons, add code behind those buttons, and have a "menu" form that you can control to a much better degree than you can the built-in switchboard.
sforney123
I have isolated the problem. It is the add feature for the following command line:
DoCmd.OpenForm "Gate Entry", acNormal, "", "[Master].[Airport Code]=[Forms].[Open1].[Combo1]", acAdd, acNormal
On Access 2007 you can set the OpenForm command macro to add a new entry if they click that particular Command button. I gues in 2003 they didn't have that feature so it is coming back as a blank value as a result it makes all of my form that is being opened from the switchboard disappear because no recordset can be located. When I converted the embedded Macros to VBA this must have occurred. Becuase when I use this VBA command to open in the edit function all the comboboxes and things show up:
DoCmd.OpenForm "Gate Entry", acNormal, "", "[Master].[Airport Code]=[Forms].[Open1].[Combo10] And [Master].[Gate ID]=[Forms].[Open1].[Combo15]", , acNormal
I guess I'll repost to try to solve this problem now that I know what it is...maybe somebody can fix my code for 2003.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.