How to auto fill controls with combobox (1 Viewer)

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 19:05
Joined
May 7, 2009
Messages
19,243
if you have Join in your query, Right click on the Line connecting your tables.
the choose "include all records from [payment table] and only those records from [other table]..."
that will make your query Updatable.

Inner Join will make your query non-updateable.
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:05
Joined
Sep 21, 2011
Messages
14,304
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..
So you assign ONE column value to each of the controls?, not all three to cone control , even if you could do it as you have written.
If for some strange reason you did want all three in one control, you would concatenate them with & and some sort of separator.

I think having looked again, you are showing all three, but not using code tags :( to give some decent separation.
If as @arnelgp suspects, you have a continuous form, then likely that will not work. Could use a datasheet instead?
 
Last edited:

moi

Member
Local time
Today, 19:05
Joined
Jan 10, 2024
Messages
202
if you have Join in your query, Right click on the Line connecting your tables.
the choose "include all records from [payment table] and only those records from [other table]..."
that will make your query Updatable.

Inner Join will make your query non-updateable.
let me try that tom, i have had enough for today..
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:05
Joined
Sep 21, 2011
Messages
14,304
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..
You canot use that syntax as a control source.
Set it in an event

Code:
Me.txtDate = Me.cboDates.Column(1)
 

moi

Member
Local time
Today, 19:05
Joined
Jan 10, 2024
Messages
202
You canot use that syntax as a control source.
Set it in an event

Code:
Me.txtDate = Me.cboDates.Column(1)
Hi can you pls expand to where should i put that code? And since i have 3 controls to fill, should i create 3 txtboxes with 3 different column assignment?
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:05
Joined
Sep 21, 2011
Messages
14,304
I would probably put it in the afterupdate event of your combo.
As you have 3 controls to fill, then you would have 3 textboxes? Those controls should be unbound I would have thought, as they are for display only?
If you want, you could just have one and concatenate them into one, but I would have thought 3 would be easier to understand for the user?
 

moi

Member
Local time
Today, 19:05
Joined
Jan 10, 2024
Messages
202
I would probably put it in the afterupdate event of your combo.
As you have 3 controls to fill, then you would have 3 textboxes? Those controls should be unbound I would have thought, as they are for display only?
If you want, you could just have one and concatenate them into one, but I would have thought 3 would be easier to understand for the user?
hi gasman,
ok can you pls put that in code how these 3 controls look like on afterupdate event pls..
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:05
Joined
Sep 21, 2011
Messages
14,304
Just as I have written above. That came from one of my controls.
 
Last edited:
  • Like
Reactions: moi

Pat Hartman

Super Moderator
Staff member
Local time
Today, 07:05
Joined
Feb 19, 2002
Messages
43,275
It seems that you have an answer but just in case, here is a link to a database of samples. Look at item # 5. It shows multiple ways you can fill controls on a form with data from tables/queries other than the one the form is bound to.

I do have some reservations on what you are doing though. If this is an app for your personal use, then, you can get away with a lot but if this is an application that others will use, I would NOT tie actual bank accounts to a type code. That is too tightly bound and it means that you can't support multiple bank accounts of any particular type.
 

Users who are viewing this thread

Top Bottom