B
Bill_De
I Have a data base form that is tabbed to have several sub forms. I created
the first form "Contacts" and then created a form called "frmRegistration".
In the registration form I have a combo box that I can select a building and
room number and then a query updates the table and removes the Check box
which is the availability or not.
Here is my problem I draged the frmRegistration over to the tab in the frm
contacts to make a sub form in tab 2. The frmContacts is in tab 1. If I fill
in all of the information in the registration form except a building and room
then click save the form saves the information and closes with no problem. If
however I enter the information and then click on the combo box named
Combo54, and select a building and room, then click save I get the following
error:
Run time Error 2450
Microsoft Access can't find the Form 'frmRegistration' referred to in a
Macro Expression or Visual Basic Code.
I then click on the debug button and the VB editor opens to my Combo54 code:
Private Sub Combo54_Exit (Cancel as Integer)
Dim db as DAO.Database
Dim qdf as QeuryDEF
Set qdf=db.Query Defs("Reserve Room")
{Yellow Highlight} qdf.Parameters(0). Value= Eval(qdf.Parameters(0).Name)
qdf.Execute dbFail on Error
Me.Combo54 Requery
When I put the cursor on the qdf.Parameters(0).Value I get the following
experssion: qdf.Parameters(0).Value=empty
When I put the cursor on the qdf.Parameters(0).Name I get the following
expression: qdf.Parameters(0).Name="[Forms]![frmRegistration]![Combo54]"
Any advise you can give me to correct this problem would be great. A note
the forms worked perfect (ran, updated, removed the selected room) until I
draged the registration form over to the second tab and made it a sub form of
the Contacts form. I am looking to remove the run time error so the form
works when draged over to the tab and made a subform
As I am new to VB I am having trouble understanding this problem. As I said
prior the form ran ok until I dragged it over to the tab now it does not
recognize the form. I copied the VB code from the data base
exactly as it is written and have attached it below:
Private Sub Combo54_Exit(Cancel As Integer)
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Set db = CurrentDb()
Set qdf = db.QueryDefs("Reserve Room")
{This is where the error is}qdf.Parameters(0).Value =
Eval(qdf.Parameters0).Name)
qdf.Execute dbFailOnError
Me.Combo54.Requery
When cursor is placed over highlighted area the following opens:
Qdf.Parameters(0).value=Empty
Qdf.Parameter(0).Name=â€[Forms]![frmRegistration]![combo54]â€
Another note on this to help you out. The combo box is in the form
"frmRegistration". Prior to placing the form in the tab when I clicked on the
combo box it would show the building and room. When I selected an item it
would place it in a text box on the form and then would remove it from the
list. All of this worked great as I said. Then when I left clicked and
dragged the form over to the tab control which at the time only had one other
form the "frmContacts" in it then went to assign a room after clicking on the
room I wanted I then clicked the save button and got the run time error
"could not find the form "frmRegistration". I get this error message even if
I click on the "X" to close the form.
As I said I am new to doing this VB stuff so any advice on what to do next
would be great as I am lost here.
Thanks
Bill
the first form "Contacts" and then created a form called "frmRegistration".
In the registration form I have a combo box that I can select a building and
room number and then a query updates the table and removes the Check box
which is the availability or not.
Here is my problem I draged the frmRegistration over to the tab in the frm
contacts to make a sub form in tab 2. The frmContacts is in tab 1. If I fill
in all of the information in the registration form except a building and room
then click save the form saves the information and closes with no problem. If
however I enter the information and then click on the combo box named
Combo54, and select a building and room, then click save I get the following
error:
Run time Error 2450
Microsoft Access can't find the Form 'frmRegistration' referred to in a
Macro Expression or Visual Basic Code.
I then click on the debug button and the VB editor opens to my Combo54 code:
Private Sub Combo54_Exit (Cancel as Integer)
Dim db as DAO.Database
Dim qdf as QeuryDEF
Set qdf=db.Query Defs("Reserve Room")
{Yellow Highlight} qdf.Parameters(0). Value= Eval(qdf.Parameters(0).Name)
qdf.Execute dbFail on Error
Me.Combo54 Requery
When I put the cursor on the qdf.Parameters(0).Value I get the following
experssion: qdf.Parameters(0).Value=empty
When I put the cursor on the qdf.Parameters(0).Name I get the following
expression: qdf.Parameters(0).Name="[Forms]![frmRegistration]![Combo54]"
Any advise you can give me to correct this problem would be great. A note
the forms worked perfect (ran, updated, removed the selected room) until I
draged the registration form over to the second tab and made it a sub form of
the Contacts form. I am looking to remove the run time error so the form
works when draged over to the tab and made a subform
As I am new to VB I am having trouble understanding this problem. As I said
prior the form ran ok until I dragged it over to the tab now it does not
recognize the form. I copied the VB code from the data base
exactly as it is written and have attached it below:
Private Sub Combo54_Exit(Cancel As Integer)
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Set db = CurrentDb()
Set qdf = db.QueryDefs("Reserve Room")
{This is where the error is}qdf.Parameters(0).Value =
Eval(qdf.Parameters0).Name)
qdf.Execute dbFailOnError
Me.Combo54.Requery
When cursor is placed over highlighted area the following opens:
Qdf.Parameters(0).value=Empty
Qdf.Parameter(0).Name=â€[Forms]![frmRegistration]![combo54]â€
Another note on this to help you out. The combo box is in the form
"frmRegistration". Prior to placing the form in the tab when I clicked on the
combo box it would show the building and room. When I selected an item it
would place it in a text box on the form and then would remove it from the
list. All of this worked great as I said. Then when I left clicked and
dragged the form over to the tab control which at the time only had one other
form the "frmContacts" in it then went to assign a room after clicking on the
room I wanted I then clicked the save button and got the run time error
"could not find the form "frmRegistration". I get this error message even if
I click on the "X" to close the form.
As I said I am new to doing this VB stuff so any advice on what to do next
would be great as I am lost here.
Thanks
Bill