In excel it would be a vlookup

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I populate a field on a form from data in another field. Here is my
example
I have a sub-form that pulls data from a table called skills. That table has
the following fields skills, e_rate, m_rate, min_rate,skill_type. the three
fields skills,min_rate and skill_type are constant. for example skills =
Windows XP , min_rate = 5, skill_type = OS. I have created a combo list so
the user can select the skill. what I want is for the min_rate and skill_type
to get populated with the information in that row. Can't seem to find out how
to do this. In excel I would be doing vlookup to populate the cells.

Can anyone shead some light on this for me. my email is (e-mail address removed)
 
In the control source of the text box you can write
=[ComboName].column(1)

The column number start with 0

==============================
Or, on the after update of the combo you can write

Me.[TextBox1]=Me.[ComboName].column(1)
Me.[TextBox2]=Me.[ComboName].column(2)
 
Thanks I had seen that but cant figure out how do write the experssion. all I
keep getting is the =[Skills].[column](1) is that because this is a subform?
Why can't I use a SELECT?

Ofer said:
In the control source of the text box you can write
=[ComboName].column(1)

The column number start with 0

==============================
Or, on the after update of the combo you can write

Me.[TextBox1]=Me.[ComboName].column(1)
Me.[TextBox2]=Me.[ComboName].column(2)

--
\\// Live Long and Prosper \\//
BS"D


hguten said:
How do I populate a field on a form from data in another field. Here is my
example
I have a sub-form that pulls data from a table called skills. That table has
the following fields skills, e_rate, m_rate, min_rate,skill_type. the three
fields skills,min_rate and skill_type are constant. for example skills =
Windows XP , min_rate = 5, skill_type = OS. I have created a combo list so
the user can select the skill. what I want is for the min_rate and skill_type
to get populated with the information in that row. Can't seem to find out how
to do this. In excel I would be doing vlookup to populate the cells.

Can anyone shead some light on this for me. my email is (e-mail address removed)
 
You can use a select, but it mean that you need to search the table again for
the record, so it can make things slower
To use a select, check help on DLookUp in Access to search for specific
field value in a specific record

DLookUp("FieldName","TableName","NumberFieldName = " & [Parameter])

Or
DLookUp("FieldName","TableName","TextFieldName = '" & [Parameter] & "'")

Or
DLookUp("FieldName","TableName","DateFieldName = #" & [Parameter] & "#")


--
\\// Live Long and Prosper \\//
BS"D


hguten said:
Thanks I had seen that but cant figure out how do write the experssion. all I
keep getting is the =[Skills].[column](1) is that because this is a subform?
Why can't I use a SELECT?

Ofer said:
In the control source of the text box you can write
=[ComboName].column(1)

The column number start with 0

==============================
Or, on the after update of the combo you can write

Me.[TextBox1]=Me.[ComboName].column(1)
Me.[TextBox2]=Me.[ComboName].column(2)

--
\\// Live Long and Prosper \\//
BS"D


hguten said:
How do I populate a field on a form from data in another field. Here is my
example
I have a sub-form that pulls data from a table called skills. That table has
the following fields skills, e_rate, m_rate, min_rate,skill_type. the three
fields skills,min_rate and skill_type are constant. for example skills =
Windows XP , min_rate = 5, skill_type = OS. I have created a combo list so
the user can select the skill. what I want is for the min_rate and skill_type
to get populated with the information in that row. Can't seem to find out how
to do this. In excel I would be doing vlookup to populate the cells.

Can anyone shead some light on this for me. my email is (e-mail address removed)
 

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

Back
Top