Auto Update field in form

enriquephoenix

New member
Local time
Today, 15:47
Joined
Apr 19, 2007
Messages
6
I have this sample database. I would like it to auto update the bananas field and the apples field when I type data into the ID field and press enter. Can somebody please help me. Thanks.
 

Attachments

Hello Jose!

I don't understand what do you want.
As I can see, the field Apples and Bananas are
already populated.
 
Hi,

What you want is a combobox to autofill the textboxes.

However, you have only one table. You need another table, if you want to bound the recordsource to that form.

In the combobox RowSource, create a query to select Table1 of the fields needed. i.e ID, Apples, Bananas.

In the combobox afterupdate event input something like

Me.apples = Me.ID.Column(1) 'column(1) is the field Apples
Me.Bananas = Me.ID.Column(2) 'column(2) is the field Bananas

This code will autofill the 2 textboxes for Apples and Bananas.
You need to Bound the ID combobox to the RecordSource called "ID".

PS. You will also need to change the combobox property "Column Count = 3"

I have this sample database. I would like it to auto update the bananas field and the apples field when I type data into the ID field and press enter. Can somebody please help me. Thanks.
 
Last edited:
Hopefully this will make more sense. I want add a search field into my form. When I input data into this search field, I want it to search for the ID number, then I want it to populate my form. I will be inputting data into the search field with a barcode scanner and I will hit enter after I scans the barcode.

Therefore, when I scan a barcode into the search field it will automatically hit enter after it scan, so this will somehow populate my form so I can make any changes as needed.

BTW, I created a new sample database with a search field.
 

Attachments

Hi,

So, What you want is a “bound search form”?

Use the AfterUpdate event to change the Form’s RecordSource property.

Me.RecordSource = “Select ID, Apples, Banana From Table1 Where ID = “ & Me.ID

Assumed ID is number, if text, change to Where ID = ‘” & Me.ID & “’”
Note the single quotes.

Or use the query grid editor. In the Criteria field of ID, input this,

Forms!YourFormNameHere!ID.

PS. The control Search must be unbound.


Hopefully this will make more sense. I want add a search field into my form. When I input data into this search field, I want it to search for the ID number, then I want it to populate my form. I will be inputting data into the search field with a barcode scanner and I will hit enter after I scans the barcode.

Therefore, when I scan a barcode into the search field it will automatically hit enter after it scan, so this will somehow populate my form so I can make any changes as needed.

BTW, I created a new sample database with a search field.
 

Attachments

Users who are viewing this thread

Back
Top Bottom