Jonathan_B
01-23-2008, 05:54 PM
Not sure if this is the place to post this, but here goes. It is related to a database I am working with.
I have 3 text boxes, 2 standard and 1 multiline text boxes. I am attempting to write some code that will prevent the program from attempting to save if one of more of the textboxes are left blank. I am able to get one of them to work, but when I attemp to add more code for the other boxes, nothing happens.
Here is the code I have for one of the boxes..ideas on the other 2, please.
Private Sub cmdJEntrySave_Click()
If frmJournalEntry.txtEntrDate = " " Then
MsgBox "Entry Sate field can not be empty", vbCritical, "Journal Entry"
frmJournalEntry.txtEntrDate.SetFocus
Else
'Opens database to update/add new records
Dim boolAdding As Boolean
boolAdding = (datJournalSave.Recordset.EditMode = adEditAdd)
datJournalSave.Recordset.Update
datJournalSave.Recordset.AddNew
End If
End Sub
The other two textboxes are named, frmJournalEntry.txtentrytime and frmJournalEntry.textJournal
I have 3 text boxes, 2 standard and 1 multiline text boxes. I am attempting to write some code that will prevent the program from attempting to save if one of more of the textboxes are left blank. I am able to get one of them to work, but when I attemp to add more code for the other boxes, nothing happens.
Here is the code I have for one of the boxes..ideas on the other 2, please.
Private Sub cmdJEntrySave_Click()
If frmJournalEntry.txtEntrDate = " " Then
MsgBox "Entry Sate field can not be empty", vbCritical, "Journal Entry"
frmJournalEntry.txtEntrDate.SetFocus
Else
'Opens database to update/add new records
Dim boolAdding As Boolean
boolAdding = (datJournalSave.Recordset.EditMode = adEditAdd)
datJournalSave.Recordset.Update
datJournalSave.Recordset.AddNew
End If
End Sub
The other two textboxes are named, frmJournalEntry.txtentrytime and frmJournalEntry.textJournal