Autopopulate fields in a form

A

acantha

I've got a database to track the hardware configurations of the variou
machines in a lab. each configuration has a config id,then a series o
fields for cd, cpu, etc.

What i want to do is create a form with a dropdown of the machin
names. Doing so will cause all the other fields to fill in with th
correct data.

I'm a newbie here, so please forgive if i'm not explaining clearly
what i've tried is i created a query that pulls the most recen
configurations for each machine name out of the database, and made
form based on that. i can make the name field a dropdown, but i
doesn't allow me to select, so it doesn't update the other fields.

the goal is to be able to find a machine name on the drop down, see it
current configuration, and then if something needs updating, select th
new hardware from the dropdown of the appropriate field then save it
 
R

Rick B

The Norhtwinds database includes a form called "Orders" that does what you
want. Go take a look at how it works and adapt your form to do the same.

Northwinds has samples of almost all common functions that one needs to
perfomr in Access. It is a great resource to consult when you are trying to
build a new object in your database.
 
S

Steve Schapel

Acantha,

I think the first key thing to recognise here is that the combobox where
you select the machine should be an *unbound* combobox, i.e. it won't
work if you are trying to do this with a combobox where the machine name
for the current record is entered.

So, let's say you have a bound textbox on your form for the MachineName,
and an unbound combobox and you name it FindMachine. Here's what you
can do... On the After Update event of the combobox, you can put code
like this:

Me.MachineName.SetFocus
DoCmd.FindRecord Me.FindMachine
Me.FindMachine = Null

However, your statement that you can't make a selection in your existing
combobox makes me suspect that the form at the moment is based on a
non-updateable query, so this could present a problem. I am not clear
on the relationship between the config id and the machine etc, so it is
hard to comment more specifically.
 
Top