DoCmd.OpenForm

  • Thread starter Thread starter Jacco
  • Start date Start date
J

Jacco

This subject is abundant if typed in Google, but I keep getting a mistake,

I have created a Form Called "Edit Aircraft". I want this form to be opened
by another form. I inserted the Sample code found in the help-file:

Private Sub Form_Open(Cancel As Integer)
Dim intReturn As Integer
intReturn = MsgBox("Do you want to configure your aircraft now?",
vbYesNo)
Select Case intReturn
Case vbYes
' Open Order Details form.
DoCmd.OpenForm "Edit Aircraft"
Case vbNo
MsgBox "Remember to configure this aircraft at a later time"
Cancel = True ' Cancel Open event.
End Select
End Sub

This triggers a error when the form is being opened saying:

Procedure declaration does not match description event or procedure having
the same name.

I set the property for Form On Open [event procedure]

I don't understand what the problem is. I created a new Form "Form1" and
inserted just the OnOpen event, and it works as advertised.

Anyone knows where the problem is?

Jacco
 
This subject is abundant if typed in Google, but I keep getting a mistake,

I have created a Form Called "Edit Aircraft". I want this form to be opened
by another form. I inserted the Sample code found in the help-file:

Private Sub Form_Open(Cancel As Integer)
Dim intReturn As Integer
intReturn = MsgBox("Do you want to configure your aircraft now?",
vbYesNo)
Select Case intReturn
Case vbYes
' Open Order Details form.
DoCmd.OpenForm "Edit Aircraft"
Case vbNo
MsgBox "Remember to configure this aircraft at a later time"
Cancel = True ' Cancel Open event.
End Select
End Sub

This triggers a error when the form is being opened saying:

Procedure declaration does not match description event or procedure having
the same name.

I set the property for Form On Open [event procedure]

I don't understand what the problem is. I created a new Form "Form1" and
inserted just the OnOpen event, and it works as advertised.

Anyone knows where the problem is?

Jacco

Where is this code?
if it's in the Form "Edit Aircraft" then it will fail

do you have a button on the calling form?
if yes then insert the code into the onClick-event of this button
 
Jacco,

Which form are you putting this on the Open event of? It seems strange
to be opening a form via the Open event of another form, and if it's the
same form it is bound to cause confusion.
 
I'll let it be for now. I recreated the form, and now it seems to work for a
while. Maybe I'll bump into the issue again later
Steve Schapel said:
Jacco,

Which form are you putting this on the Open event of? It seems strange to
be opening a form via the Open event of another form, and if it's the same
form it is bound to cause confusion.

--
Steve Schapel, Microsoft Access MVP

This subject is abundant if typed in Google, but I keep getting a
mistake,

I have created a Form Called "Edit Aircraft". I want this form to be
opened by another form. I inserted the Sample code found in the
help-file:

Private Sub Form_Open(Cancel As Integer)
Dim intReturn As Integer
intReturn = MsgBox("Do you want to configure your aircraft now?",
vbYesNo)
Select Case intReturn
Case vbYes
' Open Order Details form.
DoCmd.OpenForm "Edit Aircraft"
Case vbNo
MsgBox "Remember to configure this aircraft at a later time"
Cancel = True ' Cancel Open event.
End Select
End Sub

This triggers a error when the form is being opened saying:

Procedure declaration does not match description event or procedure
having the same name.

I set the property for Form On Open [event procedure]

I don't understand what the problem is. I created a new Form "Form1" and
inserted just the OnOpen event, and it works as advertised.

Anyone knows where the problem is?

Jacco
 

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

Similar Threads


Back
Top