Hello,
I have a form called IMO that I use to view and edit information from the table "Helpdesk" On this form there is a worklog command button. When this button is pressed the only code executed is:
the subform has the following code written in it... (feel free to blast my code all you want it helps me learn)
now everything seems to work fin up untill this point. The subform frmWorklog becomes visible. However once you click inside txtUpdateWL a new record is added to the table "Helpdesk" and I cannot for the life of me figure out why. any ideas?
Thanks!
I have a form called IMO that I use to view and edit information from the table "Helpdesk" On this form there is a worklog command button. When this button is pressed the only code executed is:
Code:
sbfrmWorklog.Visible = True
the subform has the following code written in it... (feel free to blast my code all you want it helps me learn)
Code:
Option Compare Database
'Dimension Variables
Dim strWrkLg As String
Dim WrkLgUp As String
Dim strUpdateWL As String
Dim strWorklog As String
Dim strConcatenate As String
Private Sub cmdUpdateWL_Click()
'Checks to see if the update textbox is Null
If IsNull(txtUpdateWL.Value) Then
MsgBox "Please enter the data to update"
Me!txtUpdateWL.SetFocus
End If
'Assigns variable the value of the update text box
strWrkLgUp = txtUpdateWL.Value
strUpdateWL = txtUpdateWL.Value
'Checks to see if the value is the default
'(meaning the record in the Helpdesk table is Null)
'if so, changes the value to the that of the update text box
'otherwise it combines the data with the current date
'the previous updates, and a return space
If Forms!IMO!txtWorklog.Value = "No information has been submitted" Then
txtWorklog.Value = Time() & " " & Date & " " & strUpdateWL
strWorklog = txtWorklog.Value
Forms!IMO!txtWorklog.Value = strWorklog
Else
strWrkLg = Forms!IMO!txtWorklog.Value
strConcatenate = strWrkLg & vbCrLf & vbCrLf & Time() & " " & Date & " " & strWrkLgUp
txtWorklog.Value = strConcatenate
Forms!IMO!txtWorklog.Value = strConcatenate
End If
'clear update box
txtUpdateWL.Value = Nothing
End Sub
Private Sub Command5_Click()
Forms!IMO!cmdUpdate.SetFocus
Me.Visible = False
End Sub
Private Sub Form_Load()
lblDate.Caption = Time() & " " & Date
End Sub
now everything seems to work fin up untill this point. The subform frmWorklog becomes visible. However once you click inside txtUpdateWL a new record is added to the table "Helpdesk" and I cannot for the life of me figure out why. any ideas?
Thanks!