Full Version: Disappearing Form Vba Command
UtterAccess Forums > Microsoft® Access > Access Forms
I am running 2007 and I have to convert to 2003 for implementation with my users. When using the switchboard I can open a new form set to add a new record with no problem using 2007 with the following code:
oCmd.OpenForm "Gate Entry", acNormal, "", "[Master].[Airport Code]=[Forms].[Open1].[Combo1]", acAdd, acNormal
This code does not work in 2003...when my users select the command button to open a new form it returns the form but it's entirely blank (no labels, comboboxes etc.) which is due to no record being available (I think this is the reason for the problem after researching on the internet).
Oalso have a Command button on the same switchboard that opens the same form in edit mode which works fine in both 07 and 03:
DoCmd.OpenForm "Gate Entry", acNormal, "", "[Master].[Airport Code]=[Forms].[Open1].[Combo10] And [Master].[Gate ID]=[Forms].[Open1].[Combo15]", , acNormal
I have determined the acAdd function is causing the form opened from the switchboard to be blank when running 03.
Does anyone have any different code where the command button will add a new record to my table that will set Forms.Open1.Combo1=Master.[Airport Code]?
Thank you.
I think it should have worked... the totally blank form sounds more like the form is opening Read-Only.
The whole database opens read only when you open it in 03. How do you set it not to do that?
Well, make sure you open it without the Read-Only option. If it was opened through the File | Open command and the Open Read Only option was selected I think Access remembers this.
If the reason is due to the filesystem (ie on a read-only folder) then you would probably have to move it or change the folder/file attributes.
Well somehow it is working...I think because it was opening read only. Thank you.
>>I think because it was opening read only....<<
efinitely, When the Form's Recordset is empty as in your "Add" Form, Access uses the NewRecord buffer as the CurrentRecord. However, if your database is opened as "Read-Only", the NewRecord buffer is not allowed. In this case, there is no CurrentRecord and hence, the Detail Section of the Form is not instantiated with the consequence that everything in the Detail Section disappears.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.