I have a table called tblListings with a field called "Status"
I have another table called tblSales. In the form for this table I want to have cmd button that will change the "Status" field in tblListings from PEN to SLD. The two tables are related with a field called "TRNumberL"
I can't seem to get it to run right. Can someone tell me what I'm doing wrong?
Code:
Private Sub cmdCloseSale_Click()
Dim myUpdate As String
Dim mySet As String
Dim myWhere As String
Dim strSQL As String
'set sql update statement
myUpdate = "UPDATE tblListings "
'set sql set statement
mySet = "SET Status = 'SLD' "
'set sql where statemewnt
myWhere = "WHERE TRNumberL=" & " ' " & Me!TRNumberL & "'"
'define full sql statement
strSQL = myUpdate & mySet & myWhere & ";"
DoCmd.RunSQL strSQL
End sub