Form Field Updating

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

Guest

What I am trying to do is use the results of a query based on the value of
one text box on my form to populate the values of 3 other text boxes on the
same form with the values from the query. For the sake of the discussion we
will say that my four txt boxes are UID, employee ID, name, and date of hire.
The query is based off the value i enter for the UID and returns one record
containing the other data. I'm having trouble linking my text box values to
the results of the query and i want to form to display a subform if the query
doesnt find any matching records.
 
Create a combo box where the user will select the UID,
the row source of the combo will includes all the fields that you want to
display

Select UID,[employee ID], name,[date of hire] From TableName
==============================================
The column number of the row source start with 0, so name will be column 1
==============================================
Create fields in the form, in the control source of the text box write
In the name text box
[ComboName].column(1)
In the date of hire text box
[ComboName].column(2)
etc
==============================================
Or, on the after update event of the combo, you can write the code
Me.[name] = Me.[ComboName].column(1)
Me.[date of hire] = Me.[ComboName].column(2
etc
==============================================
It is better then using dlookup on each field, because the user will access
the table only once
==============================================
and you can limit the user to select only exisiting UID
 
I wish i could make it that simple but im looking at having to scroll through
as few as 150 to as many as 950 UID so using a manually entered text field
would save time plus if the UID truly doesnt exist and its supposed to i have
to create it.

Thanks
--
If I dont remember then it didnt happen


Ofer said:
Create a combo box where the user will select the UID,
the row source of the combo will includes all the fields that you want to
display

Select UID,[employee ID], name,[date of hire] From TableName
==============================================
The column number of the row source start with 0, so name will be column 1
==============================================
Create fields in the form, in the control source of the text box write
In the name text box
[ComboName].column(1)
In the date of hire text box
[ComboName].column(2)
etc
==============================================
Or, on the after update event of the combo, you can write the code
Me.[name] = Me.[ComboName].column(1)
Me.[date of hire] = Me.[ComboName].column(2
etc
==============================================
It is better then using dlookup on each field, because the user will access
the table only once
==============================================
and you can limit the user to select only exisiting UID

--
I hope that helped
Good luck


Awofi said:
What I am trying to do is use the results of a query based on the value of
one text box on my form to populate the values of 3 other text boxes on the
same form with the values from the query. For the sake of the discussion we
will say that my four txt boxes are UID, employee ID, name, and date of hire.
The query is based off the value i enter for the UID and returns one record
containing the other data. I'm having trouble linking my text box values to
the results of the query and i want to form to display a subform if the query
doesnt find any matching records.
 
Using the combo doesnt mean that you have to scroll through the records, you
can type the UID in the combo, just as you type in a text box, and it will
retrieve the rest of the data Auto, unless it doesn't exist
--
I hope that helped
Good luck


Awofi said:
I wish i could make it that simple but im looking at having to scroll through
as few as 150 to as many as 950 UID so using a manually entered text field
would save time plus if the UID truly doesnt exist and its supposed to i have
to create it.

Thanks
--
If I dont remember then it didnt happen


Ofer said:
Create a combo box where the user will select the UID,
the row source of the combo will includes all the fields that you want to
display

Select UID,[employee ID], name,[date of hire] From TableName
==============================================
The column number of the row source start with 0, so name will be column 1
==============================================
Create fields in the form, in the control source of the text box write
In the name text box
[ComboName].column(1)
In the date of hire text box
[ComboName].column(2)
etc
==============================================
Or, on the after update event of the combo, you can write the code
Me.[name] = Me.[ComboName].column(1)
Me.[date of hire] = Me.[ComboName].column(2
etc
==============================================
It is better then using dlookup on each field, because the user will access
the table only once
==============================================
and you can limit the user to select only exisiting UID

--
I hope that helped
Good luck


Awofi said:
What I am trying to do is use the results of a query based on the value of
one text box on my form to populate the values of 3 other text boxes on the
same form with the values from the query. For the sake of the discussion we
will say that my four txt boxes are UID, employee ID, name, and date of hire.
The query is based off the value i enter for the UID and returns one record
containing the other data. I'm having trouble linking my text box values to
the results of the query and i want to form to display a subform if the query
doesnt find any matching records.
 
Thanks that will work for what i need..............now if I could only move
that drop down window for the combo...lol
--
If I dont remember then it didnt happen


Ofer said:
Using the combo doesnt mean that you have to scroll through the records, you
can type the UID in the combo, just as you type in a text box, and it will
retrieve the rest of the data Auto, unless it doesn't exist
--
I hope that helped
Good luck


Awofi said:
I wish i could make it that simple but im looking at having to scroll through
as few as 150 to as many as 950 UID so using a manually entered text field
would save time plus if the UID truly doesnt exist and its supposed to i have
to create it.

Thanks
--
If I dont remember then it didnt happen


Ofer said:
Create a combo box where the user will select the UID,
the row source of the combo will includes all the fields that you want to
display

Select UID,[employee ID], name,[date of hire] From TableName
==============================================
The column number of the row source start with 0, so name will be column 1
==============================================
Create fields in the form, in the control source of the text box write
In the name text box
[ComboName].column(1)
In the date of hire text box
[ComboName].column(2)
etc
==============================================
Or, on the after update event of the combo, you can write the code
Me.[name] = Me.[ComboName].column(1)
Me.[date of hire] = Me.[ComboName].column(2
etc
==============================================
It is better then using dlookup on each field, because the user will access
the table only once
==============================================
and you can limit the user to select only exisiting UID

--
I hope that helped
Good luck


:

What I am trying to do is use the results of a query based on the value of
one text box on my form to populate the values of 3 other text boxes on the
same form with the values from the query. For the sake of the discussion we
will say that my four txt boxes are UID, employee ID, name, and date of hire.
The query is based off the value i enter for the UID and returns one record
containing the other data. I'm having trouble linking my text box values to
the results of the query and i want to form to display a subform if the query
doesnt find any matching records.
 

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