|
|
 |
| Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Access section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

September 13th, 2009, 06:44 PM
|
|
Authorized User
|
|
Join Date: May 2009
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Combo box assigned to a field not working
I have a combo box that I set up with the wizard. It is based on a table and uses the 3rd option of searching for an existing record. The wizard allows me to set up the lookup with 2 fields, Fname and Lname in my Customers table. When the selection is made, the last name appears as the result in the combo box, which is what I want.
If I assign this control (the combo box) to the last name field, when I do a lookup and make a selection from the drop down box, I get an error message that says:
You tried to call Update or CancelUpdate or attempted to update a Field in a recordset without first calling AddNew or Edit. (Error 3020)
If I keep the combo box control as unbound and have a separate bound control for last name, then it works fine. But that seems stupid to have two controls both showing the last name field, and potentially very confusing to the users.
How do I just let the entry default to the last name field in the underlying table?
|

September 14th, 2009, 05:19 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,114
Thanks: 2
Thanked 4 Times in 4 Posts
|
|
Actually, Access is working exactly how it's supposed to. It's telling you that you cannot use a look-up control as a data entry control at the same time. If you try, what you're doing is every time you select an entry to LOOK UP, you're (in essence) CHANGING A RECORD at the same time. If you're sitting at a new record while you're doing it, you're then CREATING a new record.
A look-up combobox is exactly that and should not double as a data entry control.
What you CAN do is in the data entry combobox, you can place an AfterUpdate event to autofill other data entry fields based on the first and last name (although, not a good idea for someone like John Smith  ).
__________________
Greg Serrano
Michigan Dept. of Environmental Quality
Air Quality Division
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |