If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Autopopulate fields in a form
I've got a database to track the hardware configurations of the various machines in a lab. each configuration has a config id,then a series of fields for cd, cpu, etc. What i want to do is create a form with a dropdown of the machine names. Doing so will cause all the other fields to fill in with the 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 recent configurations for each machine name out of the database, and made a form based on that. i can make the name field a dropdown, but it 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 its current configuration, and then if something needs updating, select the new hardware from the dropdown of the appropriate field then save it. -- acanthaPosted from http://www.pcreview.co.uk/ newsgroup access |
#2
|
|||
|
|||
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. -- Rick B "acantha" acantha.1rckza@ wrote in message ... I've got a database to track the hardware configurations of the various machines in a lab. each configuration has a config id,then a series of fields for cd, cpu, etc. What i want to do is create a form with a dropdown of the machine names. Doing so will cause all the other fields to fill in with the 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 recent configurations for each machine name out of the database, and made a form based on that. i can make the name field a dropdown, but it 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 its current configuration, and then if something needs updating, select the new hardware from the dropdown of the appropriate field then save it. -- acanthaPosted from http://www.pcreview.co.uk/ newsgroup access |
#3
|
|||
|
|||
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. -- Steve Schapel, Microsoft Access MVP acantha wrote: I've got a database to track the hardware configurations of the various machines in a lab. each configuration has a config id,then a series of fields for cd, cpu, etc. What i want to do is create a form with a dropdown of the machine names. Doing so will cause all the other fields to fill in with the 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 recent configurations for each machine name out of the database, and made a form based on that. i can make the name field a dropdown, but it 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 its current configuration, and then if something needs updating, select the new hardware from the dropdown of the appropriate field then save it. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ECHO Causing Problems | DS | General Discussion | 5 | May 17th, 2005 02:19 AM |
strategy for data entry in multiple tables | LAF | Using Forms | 18 | April 25th, 2005 04:04 AM |
Design help, please | SillySally | Using Forms | 27 | March 6th, 2005 04:11 AM |
update fields in a form / subform ??? | peter junker | Running & Setting Up Queries | 0 | December 5th, 2004 11:15 AM |
Need to clear controls of Filter form | Jan Il | Using Forms | 2 | November 28th, 2004 02:04 PM |