Help with expressions / programming language

  • Thread starter Thread starter Bill
  • Start date Start date
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?
 
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
 
Back
Top