added tabs to form - now not working

G

Guest

I inherited a form with vba behind it that worked fine. I added tabs and
now, the vba is getting bugged.
I am not sure what the code is supposed to be doing, but here is the first
part:
Private Sub Form_Close()
Dim dbs As Database, rst As Recordset
Dim strSQL As String
Dim strInput As String
Dim LoopCntr As Long
Dim RecCntr As Long
Dim AllValues As String

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
'THIS IS WHERE THE DEBUGGER HIGHLIGHTS

DoCmd.SetWarnings False
Set dbs = CurrentDb

AllValues = " "

RecCntr = DCount("[ORPS Designator]", "[ISM]", "[ORPS Designator] =
Forms![ORPS Data]![ORPS Designator]")
If RecCntr > 0 Then

strSQL = "SELECT * FROM [ISM] WHERE [ORPS Designator] = " & "'" &
Forms![ORPS Data]![ORPS Designator] & "'"

.. . . and on.

Any ideas?

TIA
 
R

Rick Brandt

Papa said:
I inherited a form with vba behind it that worked fine. I added tabs
and now, the vba is getting bugged.
I am not sure what the code is supposed to be doing, but here is the
first part:
Private Sub Form_Close()
Dim dbs As Database, rst As Recordset
Dim strSQL As String
Dim strInput As String
Dim LoopCntr As Long
Dim RecCntr As Long
Dim AllValues As String

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70 'THIS IS WHERE THE DEBUGGER HIGHLIGHTS

DoCmd.SetWarnings False
Set dbs = CurrentDb

AllValues = " "

RecCntr = DCount("[ORPS Designator]", "[ISM]", "[ORPS Designator]
= Forms![ORPS Data]![ORPS Designator]")
If RecCntr > 0 Then

strSQL = "SELECT * FROM [ISM] WHERE [ORPS Designator] = " &
"'" & Forms![ORPS Data]![ORPS Designator] & "'"

. . . and on.

Any ideas?

There's nothing there that should be affected by a TabControl. But the
highlighted line is ancient code that is only supported for backward
compatability. I would try changing it to...

Me.Dirty = False

Normally the only affect adding a TabControl has is with events on controls
that you had to Cut and Paste to get them onto the TabPages. Any control
with event code tied to it that is Cut and Pasted will lose the property
setting of "[Event Procedure]" and therefore the code will stop running
unless you put that back. What you are looking at though is an event for
the Form itself and that is not affected by anything like that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top