Help with expressions / programming language

B

Bill

1. How do I take selected data from a 'text-box A' list /
drop box on a form and automatically input more detailed
data into 'text-box B' that's based upon the selection of
data in 'text-box A'?

2. How do I automatically have a user's name from a
security sign-on dialog box automatically entered into (or
assigned to) a 'Name' field of an underlying table/form?
 
S

Scott McDaniel

1. The easiest way is to include the other data you wish filled in with the
..Rowsource of the combo or list. For example, if you have a customer combo,
and you wish to have the customers address, city, etc filled in on
selection, then include that info in the combo:

SELECT lngID, strName, strStreet, strCity FROM tblCustomers (this would be
the .RowSource of your combo)

In the AfterUpdate event of your combo, "push" this info into your various
textboxes:

ComboA_AfterUpdate()

Me.TextBox1 = ComboA.Column(2) 'this would give you strStreet
Me.TextBox2 = ComboA.Columng(3) 'this would give you strCity

There are other methods, but this is the easiest for me. Note that you would
need to set the .Columns and .ColumnWidths appropriately for this to work

2. The CurrentUser() function returns the currently logged in user
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top