G
gd
This is a question about an Access 2000 database.
I'm going to ask the question in the way that I'm trying to get it to
work, but if there seems like there is a better design to avoid the
problem altogether that I haven't thought of, please mention it.
I have a form (lets say Form1) with a field that uses a combo box that
draws its data from table tblMachines. If the user searches through
the combo box for a particular choice and doesn't find it, the user
would then open up another form (Form2), which directly shows data
from table tblMachines. There, the user can add a new record (or
change an existing one), save it, and close Form2 and have the new
item available in the combo box now.
This works fine for what I have right now, with just a
Form1.Combobox.Requery on the Form2's AfterUpdate event. The problem
occurs when a user starts to edit the combobox field, then figures out
the option that the user wants is not there, and so proceeds through
the steps to change it. In this scenario, after the AfterUpdate runs,
I get the error:
2118: You must save the current field before you run the 'Requery'
action
To solve this problem I have Form1 save before the Form2's AfterUpdate
event. However this caused more problems, since the field the
combobox was for was a primary field, and gives error messages that
primary fields are null.
Seems like I'm stuck in a pickle between choice A and B, both with
pros and cons. Any suggestions?
I'm going to ask the question in the way that I'm trying to get it to
work, but if there seems like there is a better design to avoid the
problem altogether that I haven't thought of, please mention it.
I have a form (lets say Form1) with a field that uses a combo box that
draws its data from table tblMachines. If the user searches through
the combo box for a particular choice and doesn't find it, the user
would then open up another form (Form2), which directly shows data
from table tblMachines. There, the user can add a new record (or
change an existing one), save it, and close Form2 and have the new
item available in the combo box now.
This works fine for what I have right now, with just a
Form1.Combobox.Requery on the Form2's AfterUpdate event. The problem
occurs when a user starts to edit the combobox field, then figures out
the option that the user wants is not there, and so proceeds through
the steps to change it. In this scenario, after the AfterUpdate runs,
I get the error:
2118: You must save the current field before you run the 'Requery'
action
To solve this problem I have Form1 save before the Form2's AfterUpdate
event. However this caused more problems, since the field the
combobox was for was a primary field, and gives error messages that
primary fields are null.
Seems like I'm stuck in a pickle between choice A and B, both with
pros and cons. Any suggestions?