Hey,
Basically when a user enters a WorkRequestNumber in one text box this should automatically load the SalesOrderNumber into another textbox. As of yet I could not get this working. If anyone knows how to do this I'd be very grateful.
As an alternative I have created An SQL Query.
When the WorkRequestNumber textbox has been updated e.g the number "1234569" is entered. Using the AfterUpdate Event of the textbox, it then places the following SQL into the RowSource of a Listbox. (I used a listbox as I could not get the controlsource of a textbox to work)
"SELECT TblWorkRequest.SalesOrderNo FROM TblWorkRequest WHERE (((TblWorkRequest.WRNumber)= [forms]![FrmTimeSheetEntry]![WRNumber]));"
This works and places the value into the listbox, but when the record is added this value is not saved. I have found out that to actually get the value to add to the record, the listbox has to be clicked.
So my question is really 1 of 2 things,
1) is there a way to call up a field in textboxB, where the value of textboxA is equal to a records primary field.
e.g A user enters 1234569 into TextBoxA then some code searches for that field (which is a Primary Key)...
PK = 1234569, Field1 = "SON1"
If it finds it as above then it puts the Value of Field1 into TextboxB.
Or Question 2
2)Using the listbox method I have already coded is there a way to automatically store the value of the list box into the record? as apposed to having to maually click on the listbox to get it to actually add it.
Thanks in advance for any help, and please ask for clarification if unsure,
Cheers
Sam
"You couldn't fool your mother on the foolingest day of your life if you had an electrified fooling machine." - Homer
Basically when a user enters a WorkRequestNumber in one text box this should automatically load the SalesOrderNumber into another textbox. As of yet I could not get this working. If anyone knows how to do this I'd be very grateful.
As an alternative I have created An SQL Query.
When the WorkRequestNumber textbox has been updated e.g the number "1234569" is entered. Using the AfterUpdate Event of the textbox, it then places the following SQL into the RowSource of a Listbox. (I used a listbox as I could not get the controlsource of a textbox to work)
"SELECT TblWorkRequest.SalesOrderNo FROM TblWorkRequest WHERE (((TblWorkRequest.WRNumber)= [forms]![FrmTimeSheetEntry]![WRNumber]));"
This works and places the value into the listbox, but when the record is added this value is not saved. I have found out that to actually get the value to add to the record, the listbox has to be clicked.
So my question is really 1 of 2 things,
1) is there a way to call up a field in textboxB, where the value of textboxA is equal to a records primary field.
e.g A user enters 1234569 into TextBoxA then some code searches for that field (which is a Primary Key)...
PK = 1234569, Field1 = "SON1"
If it finds it as above then it puts the Value of Field1 into TextboxB.
Or Question 2
2)Using the listbox method I have already coded is there a way to automatically store the value of the list box into the record? as apposed to having to maually click on the listbox to get it to actually add it.
Thanks in advance for any help, and please ask for clarification if unsure,
Cheers
Sam
"You couldn't fool your mother on the foolingest day of your life if you had an electrified fooling machine." - Homer