Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update a control from code

Status
Not open for further replies.

camidon

Programmer
May 9, 2000
268
US
I have a form that pulls information from a single table in my database. When the user pulls up this form it is initially blank but has a combobox in it that they can select a customer from. I don't have the controlsource to this field set to anything because I want them to be able to type in a customer name and it not attempt to update the record in the database, I want it to just allow me to jump to a record. But when the users navigate using the record selectors at the bottom of the screen, obviously this field doesn't update because it's not attatched to the controlsource. How can I make it update this field when they use the record selectors???
 
Your form must have its Record Source.

Using the wizard, add a combo box in your form. Then in the option, select the third one that says [Find a record on my form based on the value I selected in my combo box]. Then just follow the wizard until its finished. Victorious Manal
ePacific Global Contact Center
Location: Manila, Philippines
Years of Programming: 3 Years
 
Sorry suoirotciv, but you're solution is not going to work here. That would mean that changing the name in the combo box would change the name for the current record, which is clearly something camidon wants to avoid.

Camidon, I would think about two possibilities. One is to put this combo box in the header of the form and put a label on it that makes it clear that this is just for selecting a record. You can then put a text box in the body of the form that holds the proper value for the current record. This is the most common solution, and the one I recommend.

If you don't like this, you could look at doing something like putting code in the Current event that sets the combo to the value of the bound text box (which might be invisible, if you only want to have one control for the name). That way it would be correct when you go to a new record, but you would be able to change what's in there without changing the name. Then, of course, you would need some way of changing the name when that's what you want to do. All around, I would suggest the first method.

Jeremy =============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995

Take a look at the Developer's section of the site for some helpful fundamentals.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top