Re: Form code fails when Openargs present...
- From: "Fred Boer" <fredboer1@xxxxxxxxxxxxxxx>
- Date: Mon, 18 Apr 2005 21:30:17 -0700
Hi Dirk:
Connecting to JET tables...
This line calls the form:
DoCmd.OpenForm ("Frm_PatronCirculationInformation"), , , , , , "Patron_ID="
& Me.cboPatronFullname
>From Frm_PatronCirculationInformation:
Private Sub Form_Current()
On Error GoTo Err_Form_Current
Me.RecordsetClone.MoveLast
Me.cmdGoNext.Enabled = Not (Me.CurrentRecord =
Me.RecordsetClone.RecordCount)
Me.cmdGoPrevious.Enabled = Not (Me.CurrentRecord = 1)
If
Forms!Frm_PatronCirculationInformation!Frm_PatronCirculationInformationSubfo
rm.Form.RecordCount = 0 Then
Me.Frm_PatronCirculationInformationSubform.Visible = False
Else
Me.Frm_PatronCirculationInformationSubform.Visible = True
End If
Me.Recalc
If Me.txtPatronType_ID <> 0 Then
Me.txtStaffFullname.Visible = False
Else
Me.txtStaffFullname.Visible = True
End If
Exit_Form_Current:
Exit Sub
Err_Form_Current:
fncWRMSErrMsg Err.Number, Err.Description
Resume Exit_Form_Current
End Sub
Private Sub Form_Load()
If Not IsNull(Me.OpenArgs) Then
With Me.RecordsetClone
.FindFirst Me.OpenArgs
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With
End If
End Sub
Private Sub Form_Open(Cancel As Integer)
On Error GoTo Err_Form_Open
'Call fncLoadcbo([Form])
DoCmd.Maximize
Exit_Form_Open:
Exit Sub
Err_Form_Open:
fncWRMSErrMsg Err.Number, Err.Description
Resume Exit_Form_Open
End Sub
That's the code. Throws 2455. And it doesn't reposition correctly after
dismissing error message. No luck with similar changes in my "barebones"
test forms either. Sure hope I'm not doing something stupid, but I can't see
anything...
Thanks!
Fred
"Dirk Goldgar" <dg@xxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:%23A900lHRFHA.3096@xxxxxxxxxxxxxxxxxxxxxxx
> "Fred Boer" <fredboer1@xxxxxxxxxxxxxxx> wrote in message
> news:uKeelbHRFHA.1416@xxxxxxxxxxxxxxxxxxxx
> > Hi Dirk:
> >
> > Thanks for taking time to help me! I certainly feel bad to have
> > stressed poor Access, and didn't mean to make it feel overwhelmed! ;)
> >
> > I've tried putting the OpenArgs/Find process in the Load event,
> > rather than the Open event, but I still get the error message. To be
> > specific, I get the error message, and then when I clear the error
> > message, the form opens positioned to the correct record. It's like
> > Acess is saying "Wait, you did this wrong!", but then it works anyway.
> >
> > Now, I'm using the recordsetclone of the subform, but I don't know if
> > I need that. I have tried just using the recordset.recordcount of the
> > subform, in case that helped, but it didn't seem to...
> >
> > I haven't mentioned that I am working with linked back end tables.
> > That wouldn't be an issue would it? The OpenArgs code uses
> > .FindFirst...
> >
> > Still puzzling...
>
> Hmm, moving the code to the Load event fixed the problem for me. Are
> you sure you didn't leave the code in the Open event, as well as copying
> it to the Load event? Please post the complete code, as it is now, from
> the form's Open, Load, and Current events.
>
> Are the linked tables in a Jet database, or are they in an ODBC data
> source like SQL Server or MSDE?
>
> --
> Dirk Goldgar, MS Access MVP
> www.datagnostics.com
>
> (please reply to the newsgroup)
>
>
.
- Follow-Ups:
- Re: Form code fails when Openargs present...
- From: Dirk Goldgar
- Re: Form code fails when Openargs present...
- References:
- Form code fails when Openargs present...
- From: Fred Boer
- Re: Form code fails when Openargs present...
- From: Dirk Goldgar
- Re: Form code fails when Openargs present...
- From: Fred Boer
- Re: Form code fails when Openargs present...
- From: Dirk Goldgar
- Re: Form code fails when Openargs present...
- From: Fred Boer
- Re: Form code fails when Openargs present...
- From: Dirk Goldgar
- Form code fails when Openargs present...
- Prev by Date: Re: Using a multi-index in VBA
- Next by Date: Re: Continuing before values returned from Query?
- Previous by thread: Re: Form code fails when Openargs present...
- Next by thread: Re: Form code fails when Openargs present...
- Index(es):
Relevant Pages
|