This time I entered the code exactly - and when I click "Save" without
hitting the Enter key in [txtNewType] the MsgBox shows a value in the first
field but is still blank in the second.
Sorry the below is kind of long - don't know how else to explain it.
Just had a thought. This whole process is for a user to add a new type of
facility to the system. The flow is a little complex - let me explain:
The db manages data about nonprofit organizations and Special Districts. One
aspect is facilities.
Facilities are first categorized by major organizational function - such as
Fire Prevention, Water Utility, Harbor, etc. There is also a General category
for types of facilities that many organizations have - such as Offices,
Warehouses, etc.
Then within each major function are specific types of facilities - Fire
Prevention has Fire Stations, Water Utilities have Water Treatment Plants,
Wells, Pumping Stations, etc.
When a user needs to add a new definition of Location Type, my first form
asks if the Location is a "General" facility (Offices, Warehouses, etc.) or
Specific (Fire Prevention, etc.).
If they select General they go directly to the 3rd form. If they select
Specific they go to a 2nd form on which they chose one of about 40 types of
organizational functions (Fire Prevention, Water, etc.). Then they go to the
3rd form (the one at issue).
The 3rd form shows the user the Major Function they chose (General or one of
the Specific) and a list of types of facilities that have already been
entered for that Major Function. It asks a question in the form of an Option
Group "Is the Facility Type You Want To Add Listed Above?" (2 buttons - Yes &
No). If they click Yes they are told since it already exists they don't need
to add it again.
IF THEY CLICK NO - and I wonder if the problem is in here somewhere - I have
code that converts both the control [txtNewType] AND the "Save New Facility
Type" button from invisible to visible. Until they get to that point those
controls are invisible.
They are then supposed to enter the New Facility Type into [txtNewType] then
click the Save Button. Here's where the problem occurs.
NOW - while the form is in Form View and after I've clicked "No" in the
Option Group, I right click [txtNewType] and open Properties and it shows
"Visible = Yes". If I change to Design View, the Property Sheet shows
"Visible = No" (which is the original setting for the field - to be changed
if the user clicks "No" in the Option Group). When I click back to Form View
the form reverts to how it looks when first opened - showing the Major
Category of facilities and any specific types that have already been listed -
BUT the Option Group choice is not made and therefore [txtNewType] and the
Save button are not visible; I have to clicik "No" again to make the 2
controls visible again.
It still seems to me vba somehow can't see data in the control until I hit
Enter. Could this have to do with the "underlying - original" invisible
property?
BUT - again, if I hit my Enter key after typing data into [txtNewType] then
click the Save Button, the MsgBox indeed HAS DATA for the second field in the
table.
This stuff can get complicated, can't it?