Philyn Gwee
New member
- Local time
- Today, 17:54
- Joined
- Apr 24, 2020
- Messages
- 7
Hi I am new here. I am trying to see what is the problem with my database. One of the Update statement does not seem to be working anymore (I realised it was since Dec 2019). I am not sure what happened as I did not make any changes to it. Hope someone could point me in the right direction.
There is a form which was created to enter staff personal records. One of the info in this form is the mobile number of the staff. When there is an entry in this mobile number field, I want it to be updated in both the table for staff personal records as well as another table which also has a mobile number field. So upon saving the form, I need two tables to be updated.
I have been trying to check the problem but not sure what is wrong, nothing seems to work.
SP_<> - These fields belong to the qrytbl_StaffPrivate table
S_<> - These fields belong to the qrytbl_Staff table
First Table -> This works fine, all updates are done.
Second Table -> Updates not done, it was working previously
There is a form which was created to enter staff personal records. One of the info in this form is the mobile number of the staff. When there is an entry in this mobile number field, I want it to be updated in both the table for staff personal records as well as another table which also has a mobile number field. So upon saving the form, I need two tables to be updated.
I have been trying to check the problem but not sure what is wrong, nothing seems to work.
SP_<> - These fields belong to the qrytbl_StaffPrivate table
S_<> - These fields belong to the qrytbl_Staff table
First Table -> This works fine, all updates are done.
Code:
'Update the staff personal records table
dbs.Execute ("UPDATE qrytbl_StaffPrivate_" & Me.SP_Branch.value & " SET SP_DOB = '" & Me.SP_DOB.value & "', SP_AddLine1 = '" & Me.SP_AddLine1.value & "', SP_AddLine2 = '" & Me.SP_AddLine2.value & "', SP_AddCode = '" & Me.SP_PostalCode.value & "', SP_TELHome = '" & Me.SP_TELHome.value & "', SP_TELMOB = '" & Me.SP_TelMobile.value & "', SP_Email = '" & Me.SP_Email.value & "', SP_Citizenship = '" & Me.SP_Citizenship.value & "', SP_Marital = '" & Me.SP_Marital.value & "', S_NOK_NAME = '" & Me.NOK_NAME.value & "', S_NOK_No1 = '" & Me.NOK_MainTel.value & "', S_NOK_No2 = '" & Me.NOK_AltTel.value & "', S_NOK_Relationship = '" & Me.NOK_Relationship.value & "', S_NOK_EMAIL = '" & Me.NOK_Email.value & "', S_Med_Conditions = '" & Me.SP_Condtions.value & "', S_Diet = '" & Me.SP_Diet.value & "', S_Notes = '" & Me.SP_Notes.value & "', SP_SeasonPark = " & Me.SP_SeasonPark.value & " WHERE SP_NRIC = '" & Me.SP_NRIC.value & "'")
Second Table -> Updates not done, it was working previously
Code:
'Mobile field is not empty
If (Not RequireInputVal(Me.SP_TelMobile.value)) Then
'Update the staff table
dbs.Execute ("UPDATE qrytbl_Staff_" & Me.SP_Branch.value & " SET S_Phone = '" & CStr(Me.SP_TelMobile.value) & "' WHERE S_NRIC = '" & Me.SP_NRIC.value & "'")
End If
Last edited by a moderator: