Hello all,
I'm having a problem with a piece of VB code in a program that I am trying to create for work.
Basically I am trying to write a function that will write information out of a table to various fields on a form. I plan to call this function from the On_Change event handler of each field. The following piece of code is where I'm having difficulty.
With tbl2
.Find strWoNum
If .EOF = True Then
MsgBox "That is not a valid Work Order Number", vbCritical, "ERROR"
DoCmd.DeleteObject acTable, "WoInfo"
Else:
TimeCard!["strText1"] = tbl2("EQNUM")
TimeCard!["strText2"] = tbl2("TASKDESC")
tbl2.Close
End If
End With
The problem is with the bold code. I can not get access to recognize that "strText1" is a variable pointing to the name of a field on the form. It wants to take everything inside the brackets as the field name. Is there any way I can get around this??
If you can give me any help at all it will be GREATLY appriciated...
Thank you
I'm having a problem with a piece of VB code in a program that I am trying to create for work.
Basically I am trying to write a function that will write information out of a table to various fields on a form. I plan to call this function from the On_Change event handler of each field. The following piece of code is where I'm having difficulty.
With tbl2
.Find strWoNum
If .EOF = True Then
MsgBox "That is not a valid Work Order Number", vbCritical, "ERROR"
DoCmd.DeleteObject acTable, "WoInfo"
Else:
TimeCard!["strText1"] = tbl2("EQNUM")
TimeCard!["strText2"] = tbl2("TASKDESC")
tbl2.Close
End If
End With
The problem is with the bold code. I can not get access to recognize that "strText1" is a variable pointing to the name of a field on the form. It wants to take everything inside the brackets as the field name. Is there any way I can get around this??
If you can give me any help at all it will be GREATLY appriciated...
Thank you