J
jms
Greetings all:
I have a multi tab form which I do a data integrity check on each tab on the
before update event. It worked great for me. I am on terminal server. Works
great from one location. But in my third location when a user lets there
machine go into save mode and they come back tand reenter their password into
the screen saver the code, on my form, runs and asks them if they would like
to complete or delete the record,.
which it should do when a user tries to leave an incomplete record. But it
keeps asking them an never does the action associated with the yes or the no.
I thought it may have to do with the record not committing. So I moved the
code so the code runs off of the on change event of leaving one tab for
another one, thus allowing the incomplete record to be committed but not
letting the user leave it without completing or deleting it. This helped
minorly, they can now press yes three times to get back into the record. I
made sure there was only one incomplete record during testing.
Here is the code on the OnChange Event as part of a long elseif. Same basic
code runs for each tab.
'Checking that Prelim OB Tests are complete
If Forms!frmDogTestInfo!fsubPrelimOB.Form!cboGrade.Visible And IsBlank
(Forms!frmDogTestInfo!fsubPrelimOB.Form!cboGrade) And Me.TabCtl25.Value <> 0
Then
y = MsgBox("A test in Prelim OB is incomplete. Complete select Yes,
Delete select No.", vbYesNo)
If y = vbYes Then
gvarComplete = "No"
Me.fsubPrelimOB.SetFocus
Else
gvarComplete = "Yes"
'Delete Testing Category incomplete data entry, at users
request
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE * FROM tblTRNTestingCategories WHERE
tblTRNTestingCategories.ttc_TestingID = " & Forms!frmDogTestInfo!fsubPrelimOB.
Form.tdt_TestingID
DoCmd.SetWarnings True
'Delete Primary Test Info incomplete data entry, at users
request
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE * FROM tblTRNTesting WHERE tblTRNTesting.
tdt_TestingID = " & Forms!frmDogTestInfo!fsubPrelimOB.Form.tdt_TestingID
DoCmd.SetWarnings True
Me.Refresh
DoCmd.GoToRecord , , acNewRec
Exit Sub
End If
Any suggestions would be helpful.
I have a multi tab form which I do a data integrity check on each tab on the
before update event. It worked great for me. I am on terminal server. Works
great from one location. But in my third location when a user lets there
machine go into save mode and they come back tand reenter their password into
the screen saver the code, on my form, runs and asks them if they would like
to complete or delete the record,.
which it should do when a user tries to leave an incomplete record. But it
keeps asking them an never does the action associated with the yes or the no.
I thought it may have to do with the record not committing. So I moved the
code so the code runs off of the on change event of leaving one tab for
another one, thus allowing the incomplete record to be committed but not
letting the user leave it without completing or deleting it. This helped
minorly, they can now press yes three times to get back into the record. I
made sure there was only one incomplete record during testing.
Here is the code on the OnChange Event as part of a long elseif. Same basic
code runs for each tab.
'Checking that Prelim OB Tests are complete
If Forms!frmDogTestInfo!fsubPrelimOB.Form!cboGrade.Visible And IsBlank
(Forms!frmDogTestInfo!fsubPrelimOB.Form!cboGrade) And Me.TabCtl25.Value <> 0
Then
y = MsgBox("A test in Prelim OB is incomplete. Complete select Yes,
Delete select No.", vbYesNo)
If y = vbYes Then
gvarComplete = "No"
Me.fsubPrelimOB.SetFocus
Else
gvarComplete = "Yes"
'Delete Testing Category incomplete data entry, at users
request
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE * FROM tblTRNTestingCategories WHERE
tblTRNTestingCategories.ttc_TestingID = " & Forms!frmDogTestInfo!fsubPrelimOB.
Form.tdt_TestingID
DoCmd.SetWarnings True
'Delete Primary Test Info incomplete data entry, at users
request
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE * FROM tblTRNTesting WHERE tblTRNTesting.
tdt_TestingID = " & Forms!frmDogTestInfo!fsubPrelimOB.Form.tdt_TestingID
DoCmd.SetWarnings True
Me.Refresh
DoCmd.GoToRecord , , acNewRec
Exit Sub
End If
Any suggestions would be helpful.