Hi,
I am fairly new to programming and am trying to figure this one out. I have searched this forum at length and found another thread that had something similiar but I cant quite get it to work ( http://www.access-programmers.co.uk/forums/showthread.php?t=201644 ).
On my form when the user enters in the CertNum I would like an unbound text box to autopopulate with the Business Name associated with that CertNum.
txtbox_GetBusName - My unbound textbox that I would like to be autopopulated with BusName
CertNum - Where the user enters in a number
BusName - Business Name
This is what I have tried:
Private Sub txtbox_GetBusName_AfterUpdate()
Me.txtbox_GetBusName = DLookup("BusName", "[CertNum] = '" & Me.CertNum & "'")
End Sub
What am I doing wrong? It also occured to me to set the control source of the unbound text box to a query, but that didnt work also. What is the best and most efficient way to perform this task?
I am fairly new to programming and am trying to figure this one out. I have searched this forum at length and found another thread that had something similiar but I cant quite get it to work ( http://www.access-programmers.co.uk/forums/showthread.php?t=201644 ).
On my form when the user enters in the CertNum I would like an unbound text box to autopopulate with the Business Name associated with that CertNum.
txtbox_GetBusName - My unbound textbox that I would like to be autopopulated with BusName
CertNum - Where the user enters in a number
BusName - Business Name
This is what I have tried:
Private Sub txtbox_GetBusName_AfterUpdate()
Me.txtbox_GetBusName = DLookup("BusName", "[CertNum] = '" & Me.CertNum & "'")
End Sub
What am I doing wrong? It also occured to me to set the control source of the unbound text box to a query, but that didnt work also. What is the best and most efficient way to perform this task?