Open Form from Switchboard Error

J

JohnV

I have a form that contains a subform. The form has a
combo box that allows the user to select from and then
synchronizes the subform to filter on that item.

The problem is that when I open the form through the
Switchboard I get an error when I select an item from the
combo box:
"Run-time error '3021':" and "No current record"

I noticed in the code for the combo box which I included
below that it uses a bookmark. This is the point where it
errors. As I stated earlier, when I open the form
directly it works fine.
Private Sub Combo32_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Office] = '" & Me![Combo32] & "'"
Me.Bookmark = rs.Bookmark
End Sub

Any help would be appreciated.

Regards,
JohnV
 
D

dina

I think the switchboard does not know or recognize
the "Me!" - from the switchboard you must call the form
by name - the me reference only owrks when there is only
one possible form to refer to.
 
J

JohnV

I now have specified the form instead of using "Me!". I
still have the same problem.

I have also noticed that when I open the form from the
switchboard that my form no longer has the first record
loaded or the ability to navigate among the records. This
leads me to believe that the problem is on the initial
opening of the form from the switchboard.

Thanks,
JohnV
-----Original Message-----
I think the switchboard does not know or recognize
the "Me!" - from the switchboard you must call the form
by name - the me reference only owrks when there is only
one possible form to refer to.
-----Original Message-----
I have a form that contains a subform. The form has a
combo box that allows the user to select from and then
synchronizes the subform to filter on that item.

The problem is that when I open the form through the
Switchboard I get an error when I select an item from the
combo box:
"Run-time error '3021':" and "No current record"

I noticed in the code for the combo box which I included
below that it uses a bookmark. This is the point where it
errors. As I stated earlier, when I open the form
directly it works fine.
Private Sub Combo32_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Office] = '" & Me![Combo32] & "'"
Me.Bookmark = rs.Bookmark
End Sub

Any help would be appreciated.

Regards,
JohnV
 

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

n Form from Switchboard Error 1
Error 2147352567 2
RunTime Error 3070 8
recordset.clone 13
Recordset Clone using Autonumber 3
Code Error 2
Combo Box Updates, but Form/Data Doesn't 13
Combo Box Error 3077 - Access 2003 1

Top