Poulaying fields from table with specified criteria

  • Thread starter Thread starter Les
  • Start date Start date
L

Les

I have a form "frmProject_Record" with the field "strProject_Name" this form
als has 2 other fields of "strProject_Type" and "strCompany"

On exit from "strProject_Record" I need to update "strProject_Type" and
"strCompany" from the table "tblHigh_Level_Project"

I need to use a criteria which will match the field "strProject_Title" from
"tblHigh_Level_Project" to the form field
"frmProject_Record"!"strProject_Name" then update the other fields with the
correct data for that record.

I know this is quite simple but I cant seem to get it to work.

Any help appreciated.

Thanks

Les
 
Create an update query to change tblHigh_Level_Project using the criteria on
the form frmProject_Record before it closes, use the text box name not the
field name ([Forms]![frmProject_Record].[txtProject_Title]. If this is done
using a button to close the form, just have it run the query before the
close command.

Kelvin
 
Thanks Kelvin

I shopuld have added tht the user needs to see this information befor
completing the rest of the form, hence the need for update.


Kelvin said:
Create an update query to change tblHigh_Level_Project using the criteria on
the form frmProject_Record before it closes, use the text box name not the
field name ([Forms]![frmProject_Record].[txtProject_Title]. If this is done
using a button to close the form, just have it run the query before the
close command.

Kelvin

Les said:
I have a form "frmProject_Record" with the field "strProject_Name" this form
als has 2 other fields of "strProject_Type" and "strCompany"

On exit from "strProject_Record" I need to update "strProject_Type" and
"strCompany" from the table "tblHigh_Level_Project"

I need to use a criteria which will match the field "strProject_Title" from
"tblHigh_Level_Project" to the form field
"frmProject_Record"!"strProject_Name" then update the other fields with the
correct data for that record.

I know this is quite simple but I cant seem to get it to work.

Any help appreciated.

Thanks

Les
 
You mean you want to fill out the form with the correct information. When
you said update I thought you meant the table. My mistake. To fill out the
form, there are many ways to do this. Although I do not know why you would
want to fill out these fields if they are coming from the table
"tblHigh_Level_Project". You could just create a link to this table and
show it when ever you need. Here is a simple method using the DLookup
command. On the AfterUpdate event of "strProject_Record" put in:

strProject_Type = DLookup("[ProjectTypeFieldFromOtherTable]" ,
"tblHigh_Level_Project" , "[strProject_Title] = strProject_Name")

strCompany = DLookup("[CompanyFieldFromOtherTable]" ,
"tblHigh_Level_Project" , "[strProject_Title] = strProject_Name")

Kelvin Lu

Les said:
Thanks Kelvin

I shopuld have added tht the user needs to see this information befor
completing the rest of the form, hence the need for update.


Kelvin said:
Create an update query to change tblHigh_Level_Project using the
criteria
on
the form frmProject_Record before it closes, use the text box name not the
field name ([Forms]![frmProject_Record].[txtProject_Title]. If this is done
using a button to close the form, just have it run the query before the
close command.

Kelvin

Les said:
I have a form "frmProject_Record" with the field "strProject_Name"
this
form
als has 2 other fields of "strProject_Type" and "strCompany"

On exit from "strProject_Record" I need to update "strProject_Type" and
"strCompany" from the table "tblHigh_Level_Project"

I need to use a criteria which will match the field "strProject_Title" from
"tblHigh_Level_Project" to the form field
"frmProject_Record"!"strProject_Name" then update the other fields
with
the
correct data for that record.

I know this is quite simple but I cant seem to get it to work.

Any help appreciated.

Thanks

Les
 
Back
Top