How to auto fill controls with combobox (1 Viewer)

moi

Member
Local time
Today, 17:24
Joined
Jan 10, 2024
Messages
202
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..
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:24
Joined
Oct 29, 2018
Messages
21,473
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.
 

LarryE

Active member
Local time
Today, 02:24
Joined
Aug 18, 2021
Messages
591
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:

moi

Member
Local time
Today, 17:24
Joined
Jan 10, 2024
Messages
202
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..
 

moi

Member
Local time
Today, 17:24
Joined
Jan 10, 2024
Messages
202
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..
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:24
Joined
Oct 29, 2018
Messages
21,473
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).
 

moi

Member
Local time
Today, 17:24
Joined
Jan 10, 2024
Messages
202
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.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 10:24
Joined
Jul 9, 2003
Messages
16,282
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:

moi

Member
Local time
Today, 17:24
Joined
Jan 10, 2024
Messages
202
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.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 17:24
Joined
May 7, 2009
Messages
19,243
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).
 

moi

Member
Local time
Today, 17:24
Joined
Jan 10, 2024
Messages
202
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..
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 17:24
Joined
May 7, 2009
Messages
19,243
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?).
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 17:24
Joined
May 7, 2009
Messages
19,243
I made a simple demo.
see qryPayment and open Payment form.
on tblPayment, only the MOP (MopID) is being saved.
 

Attachments

  • Database1.accdb
    632 KB · Views: 32

moi

Member
Local time
Today, 17:24
Joined
Jan 10, 2024
Messages
202
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..
 

moi

Member
Local time
Today, 17:24
Joined
Jan 10, 2024
Messages
202
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.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 17:24
Joined
May 7, 2009
Messages
19,243
you need to use a Query.
it will not work, specially if your form is Continuous form.
 

moi

Member
Local time
Today, 17:24
Joined
Jan 10, 2024
Messages
202
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..
 

Gasman

Enthusiastic Amateur
Local time
Today, 10:24
Joined
Sep 21, 2011
Messages
14,301
MOP Account Number Account Name
=[cboMOP].column(1) =[cboMOP].column(2) =[cboMOP].column(3)
Spaces in control name?
Assigning it to which column value?
 

moi

Member
Local time
Today, 17:24
Joined
Jan 10, 2024
Messages
202
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..
 

moi

Member
Local time
Today, 17:24
Joined
Jan 10, 2024
Messages
202
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

Top Bottom