Update a table from a form combo box

  • Thread starter Thread starter Claude Mathieu
  • Start date Start date
C

Claude Mathieu

Hope you can point me in the right direction.

For simplicity's sake, assume one table with the following fields;



<table_customers>

fld_customerID (autonumber)

fld_name

fld_city



I'm trying to develop a form where the user can:

a) use a combo box to select a customer name from
table_customers<completed>,

b) view the details associated with the particular selection <completed>,

c) edit and/or add to the fields (i.e., modify or add the city) using the
same form,<need help here>

d) using a command button, update the table with the new information just
entered.<need help here>



I am not new to VB (self-taught VB in Excel) but I am a newbie to Access. I'
m a bit lost at this point and what information I was able to find assumed a
high level of VB/Access knowledge - so I can't seem to make the jump to
where I want to go. Can anyone point me to examples of this so I can build
from there or outline a simple step by step plan.



Thank you!



Claude
 
Try this -
it should come close to what you're asking for:

Select your table in the Database Window.
On your menu, click Insert, and at the very bottom, AutoForm.
You will get a form showing all the fields in your table, with navigation
buttons at the bottom to move through the records.
NOTE: Any changes you make to data through this form are written to the
table when you leave the record. This includes closing the form. You don't
need any special buttons to save the data, in fact, it's rather a bother to
prevent changes from being saved.

Now you have your form, on your menu, click View - Design View.
You can change the layout and a bunch of other properties of your form and
controls here.
Now go to your toolbox and add a combobox.
A wizard should start, asking what you want the combobox to do. Select
the 3rd option - go to a record based on the value in the combobox. The
wizard will walk you through the rest of it.

Return to Form View.
Now you can select a value in the combobox, and the form will move to the
associated record.
You can edit any values you wish, and when you leave the record, the values
will be saved.

Hope this is close enough to your wishes.

- Turtle
 
Actually, if you look at the code page, you'll see that the wizard did write
some VBA for you.

Glad it's what you wanted!

- Turtle
 
Back
Top