S
Stewart Berman
Simplified Version:
Access 2007
Create a table with an automumber ID Primary Key and three text fields: Field1, Field2, Field3
Add a few records to the table.
Use the wizard to create a datasheet form (call it form1) based on the table.
In the Form_Current event put:
Private Sub Form_Current()
MsgBox "Field1: " & Me.Field1 & ", Field2: " & Me.Field2 & ", Field3: " & Me.Field3
End Sub
When you open the form you get the message box for the first record and if you click on another
record you get the message box for that record.
Now open the form in design mode and delete the Field3 textbox (and label). Save the form and open
it in form mode. You still see the message box for each record. If you go into the immediate
window and type Me. you will see all three fields listed.
Now close the form.
Open another database and import form1 form the first. Now import form1 back into the first
database from the second. It will come in as Form11. Open the form and it will throw a compile
error flagging Me.Field2 as missing. But if you go into the immediate window and type Me. you will
find Field2 but not Field3.
My questions are:
1. Should Form1 have still worked after deleting Field3 (the textbox and label) from the detail
section?
2. If Form1 should still work then why doesn't Form11 (the one that was copied back and forth
between database1 and databse2) work?
3. If the forms shouldn't work because the Field3 textbox was deleted why is Field2 flagged as
missing in form11?
We hit some of these problems because we are doing distributed development on a large Access 2007
application. To minimize collisions each developer "owns" the objects they are working on. We
integrate them back together by having each developer copy the objects that are ready for
integration from their development database to a new small database that then only has those
objects. That database is then sent to the person responsible for integrating the changes.
Periodically, the integrated database is sent out to the developers to use as a new baseline.
Unfortunately, this results in some odd behavior where an object works fine before being copied but
not after. It appears that the only way to safely transport objects is to use saveastext and
loadfromtext as that appears to stop the objects from changing by being copied.
By the way a comparison of form1 and form11 text files produced by saveastext shows differences in
GUIDs and in one line in the NameMap.
Access 2007
Create a table with an automumber ID Primary Key and three text fields: Field1, Field2, Field3
Add a few records to the table.
Use the wizard to create a datasheet form (call it form1) based on the table.
In the Form_Current event put:
Private Sub Form_Current()
MsgBox "Field1: " & Me.Field1 & ", Field2: " & Me.Field2 & ", Field3: " & Me.Field3
End Sub
When you open the form you get the message box for the first record and if you click on another
record you get the message box for that record.
Now open the form in design mode and delete the Field3 textbox (and label). Save the form and open
it in form mode. You still see the message box for each record. If you go into the immediate
window and type Me. you will see all three fields listed.
Now close the form.
Open another database and import form1 form the first. Now import form1 back into the first
database from the second. It will come in as Form11. Open the form and it will throw a compile
error flagging Me.Field2 as missing. But if you go into the immediate window and type Me. you will
find Field2 but not Field3.
My questions are:
1. Should Form1 have still worked after deleting Field3 (the textbox and label) from the detail
section?
2. If Form1 should still work then why doesn't Form11 (the one that was copied back and forth
between database1 and databse2) work?
3. If the forms shouldn't work because the Field3 textbox was deleted why is Field2 flagged as
missing in form11?
We hit some of these problems because we are doing distributed development on a large Access 2007
application. To minimize collisions each developer "owns" the objects they are working on. We
integrate them back together by having each developer copy the objects that are ready for
integration from their development database to a new small database that then only has those
objects. That database is then sent to the person responsible for integrating the changes.
Periodically, the integrated database is sent out to the developers to use as a new baseline.
Unfortunately, this results in some odd behavior where an object works fine before being copied but
not after. It appears that the only way to safely transport objects is to use saveastext and
loadfromtext as that appears to stop the objects from changing by being copied.
By the way a comparison of form1 and form11 text files produced by saveastext shows differences in
GUIDs and in one line in the NameMap.