Code help - Form misbehaving
Can someone please tell me what is going wrong with this code. It happens periodically. Even though there is a request on another form in the form of
docmd.openform "frmname"
Forms!frmname.recordsource = strsql
Forms!frmname.requery
However for some reason new record is being activated.
Private Sub Form_Load()
'set the error trap
On Error GoTo errorhandler
'transfer the name of the calling form
callform = gstrcallingform
'clear the global calling form holder
gstrcallingform = ""
'reset the btnclick
btnclick = False
'check if it is a new record
If Me.NewRecord = True Then
'it is so reset the risk counter
priskval = 0
'set the risk level to low on screen
Me.productrisk.Value = "Low"
Else
'set the risk counter for the appropriate level of risk
Select Case Me.productrisk.Value
Case "Low"
priskval = 1
Case "Medium"
priskval = 3
Case "high"
priskval = 4
End Select
End If
clock
'set the option field to show case details
Me.optfileinspect.Value = 1
'call the frame selection routine
Call optfileinspect_AfterUpdate
'move the focus to the ar firm name
Me.arfirm.SetFocus
exitld:
Exit Sub
errorhandler:
generalerrorhandler Err.Number, Err.Description, ffile, "form_load"
Resume exitld
Resume
End Sub
|