How to auto fill controls with combobox

moi

Member
Local time
Today, 09:20
Joined
Jan 10, 2024
Messages
273
Hi all,

This is basic but I can't figure out how to do it, Im a newbie to Access.

I have a controls;

MOP (mode of payment)
A/C Number
A/C Name

What i wanted to do is, if i select Bank for MOP, it will filled the MOP with "BankName", "A/C#" and A/CName.. 3 controls to be autofill. like the below.

UB Bank - 123456789 - moi

I setup a table with "Cash, BankName, A/C # and A/C Name..

Any help is much appreciated.

Thank you..
 
Hi. If you can include all the info in the combo row source , then you can display those info by using the Column property of the combo.
 
Hi all,

This is basic but I can't figure out how to do it, Im a newbie to Access.

I have a controls;

MOP (mode of payment)
A/C Number
A/C Name

What i wanted to do is, if i select Bank for MOP, it will filled the MOP with "BankName", "A/C#" and A/CName.. 3 controls to be autofill. like the below.

UB Bank - 123456789 - moi

I setup a table with "Cash, BankName, A/C # and A/C Name..

Any help is much appreciated.

Thank you..
Before anything else is done:
  1. Change A/C # to AC_Num
  2. Change A/C Name to AC_Name
And never ever use special characters (like / or #) in field names
 
Last edited:
Hi. If you can include all the info in the combo row source , then you can display those info by using the Column property of the combo.
I will include all those info through wizard, how then i will filled those in each corresponding control..
 
Before anything else is done:
  1. Change A/C # to AC_Num
  2. Change A/C Name to AC_Name
And never ever us special characters (like / or #) in field names
Thanks for the reminder, can you pls guide me through to do the auto fill pls..
 
I will include all those info through wizard, how then i will filled those in each corresponding control..
For example, in the control source of the textbox:
Code:
=[ComboboxName].Column(x)
Where 'x' is the column number starting with zero (0).
 
For example, in the control source of the textbox:
Code:
=[ComboboxName].Column(x)
Where 'x' is the column number starting with zero (0).
Thank you, will try this one.
 
Where 'x' is the column number starting with zero (0).

What DBguy said but as a video:-

Get Info From a Combo-box 1 - Nifty Access

More on Nifty Access website:-

Display Data from a Combo Box​

 
Last edited:
What DBguy said but as a video:-

Get Info From a Combo-box 1 - Nifty Access

More on Nifty Access website:-

Display Data from a Combo Box​

Hi,

Thank you, sometimes a video doing the things you wanted to say is a bit helpfull to a newbie..

Many thanks indeed.
 
I setup a table with "Cash, BankName, A/C # and A/C Name..
if you already have them in a table, you only need the UniqueID of the MOP. The A/c and A/C Name is but for showing only (ubound textbox) (not to be saved again on another table). if you save it again on the table, you are Not following Normalization (no repeating information that you can easily retrieved from another table).
 
if you already have them in a table, you only need the UniqueID of the MOP. The A/c and A/C Name is but for showing only (ubound textbox) (not to be saved again on another table). if you save it again on the table, you are Not following Normalization (no repeating information that you can easily retrieved from another table).
ok so if i don't save the MOP, BankName, A/C# and A/C Name, what will the user see on entry form? ID alone is no meaning to the user.. Can you please expand, i could not follow..
 
i did not say not to save the MOP, but to save only its UniqueID or PK (MopID).
I setup a table with "Cash, BankName, A/C # and A/C Name.
you add an AutoNumber (MopID) to the above table and use the mopID when saving to another table (payment table?).
 
I made a simple demo.
see qryPayment and open Payment form.
on tblPayment, only the MOP (MopID) is being saved.
 

Attachments

For example, in the control source of the textbox:
Code:
=[ComboboxName].Column(x)
Where 'x' is the column number starting with zero (0).
Thank you, will try this one
I made a simple demo.
see qryPayment and open Payment form.
on tblPayment, only the MOP (MopID) is being saved.
Am trying to implement the autofill from your demo, but may query is getting lock.. tblPayment and tblMOP.. I duplicated your query to my query.. Link field is "MOP" (number) of tbl Payment and MOPID (pk autonumber) of tblMOP..
 
Hi. If you can include all the info in the combo row source , then you can display those info by using the Column property of the combo.
hi theDBGuy,

am trying to use the column property, i got it display for the 3 columns of the first row, but when i enter the data for the second row, it change also the first row, how would i fix that.. i use the below

MOP Account Number Account Name
=[cboMOP].column(1) =[cboMOP].column(2) =[cboMOP].column(3)

am i doing wrong?. pls i need help.
 
you need to use a Query.
it will not work, specially if your form is Continuous form.
 
I made a simple demo.
see qryPayment and open Payment form.
on tblPayment, only the MOP (MopID) is being saved.
i tried to duplicate your db demo, but my query turns out unupdatable..
 
MOP Account Number Account Name
=[cboMOP].column(1) =[cboMOP].column(2) =[cboMOP].column(3)
Spaces in control name?
Assigning it to which column value?
 
you need to use a Query.
it will not work, specially if your form is Continuous form.
yes am trying to duplicate your demo but i think i did it incorrect.. it turns out unupdatable..
 
Spaces in control name?
Assigning it to which column value?
column(1) is for the MOP ie Cash, GCash, Bank, Check
column(2) is for the bank account number
column(3) is for the bank account name..
 

Users who are viewing this thread

Back
Top Bottom