find a record set hopefully quick question

swarv

Registered User.
Local time
Today, 16:41
Joined
Dec 2, 2008
Messages
196
I have the following code

Code:
    Dim rs As Object
    Set rs = Me.Recordset.Clone
    rs.FindFirst "[LastName] = '" & Me![Combo60] & "'"
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark

which works fine as it is the code behind a combo button.
I would like to change it so that it also works when form loads. e.g. when it loads then I would like the form to go instantly to 1 record.

I tried changing to the middle line to

Code:
    rs.FindFirst "[username] = '" & Forms!Frm_homepage![user_id] & "'"

and placing the code into the form open section but it errors.

is there any reason for this?

Thanks

Martin
 
Code:
...but it errors.
What error? :confused:
Please provide everything you know about the problem. :)
Cheers,
 
Please see attached.
This is the file I am trying to put into my other database.
I would like it so that when the form is opened it goes straight to show the data from field 'storey'.
But still able to pick a different year from the top combo box.

Thanks
Martin
 

Attachments

No record data is available at the open_form event, you need to add in on_load event.
 
Hi,

I have posted a new version of the DB with what I want to happen in the code under form load. (still doesn't work)
Just click the open form button on the screen that appears.

Many thanks
Martin
 

Attachments

An Access.Label doesn't have a default property so if you mean to reference its Caption property you must do so explicitly...
Code:
Forms!Form1.Label3.Caption
 

Users who are viewing this thread

Back
Top Bottom