Hi All
I am working towards getting my database going and I have encountered another problem. Will be greatly appreciated if someone can provide some help.
Based on the selection of the combo boxes (cboLoc and cboItem), it will look up the Current Test Date and Current Test Tag values from tblTestTag. These values will then be displayed in txtCurrentDate and txtCurrentTag.
txtNewDate and txtNewTag are manually entered after inspection. I want both txtNewDate and txtNewTag to be entered before cmdSave is enabled and their values to be updated and saved in tblTestTag after clicking cmdSave.
I have attempted to write the SQL as follows but it did not work because of my limited VBA knowledge.
Thank you in advance.
I am working towards getting my database going and I have encountered another problem. Will be greatly appreciated if someone can provide some help.
Based on the selection of the combo boxes (cboLoc and cboItem), it will look up the Current Test Date and Current Test Tag values from tblTestTag. These values will then be displayed in txtCurrentDate and txtCurrentTag.
txtNewDate and txtNewTag are manually entered after inspection. I want both txtNewDate and txtNewTag to be entered before cmdSave is enabled and their values to be updated and saved in tblTestTag after clicking cmdSave.
I have attempted to write the SQL as follows but it did not work because of my limited VBA knowledge.
Code:
Private Sub cmdSave_Click()
Dim db As Database
CurrentDb.Execute
If Not IsNull(Me.txtNewDate) Or Me.txtNewDate = "" Then
If Not IsNull(Me.txtNewTag) Or Me.txtNewTag = "" Then
Update tblTestTag
Set TestDate = Me.txtNewDate.Value And TagNo = Me.txtNewTag.Value
WHERE Location = cboLoc And Item = cboItem
End Sub
Last edited by a moderator: