passing record number to a form..

C

Craig Armitage

Hi,

I have a form that shows customer records and I want to open another form
but pass the number of the record thats showing on the first form..

Im assuming i use the following basic code

docmd.OpenForm("frm_Appointments",acNormal,,,acFormAdd,,<record number>)

but i dont know how to get the value of the current record number..

please help!


but i dont know
 
A

Albert D. Kallal

Craig Armitage said:
Hi,

I have a form that shows customer records and I want to open another form
but pass the number of the record thats showing on the first form..

Im assuming i use the following basic code

docmd.OpenForm("frm_Appointments",acNormal,,,acFormAdd,,<record number>)

but i dont know how to get the value of the current record number..

please help!

Are you really sure you're looking for the record number, or do you mean the
unique primary key identifier of the current record you're looking at? The
current record position has absolutely no meaning at all in MS access.
Adding new records clicking on a sort button or filtering are all going to
cause that record number to change quite a bit.

I am thinking that you actually looking to pass the primery key value?

you would use:

docmd.OpenForm "frm_Appointments",acNormal,,,acFormAdd,,me!ID

However, if you *really* are looking for the current reocrd number (the
number currently displayed in the navigation box), then use:

docmd.OpenForm "frm_Appointments",acNormal,,,acFormAdd,,me.CurrentRecord
 
G

Guest

well.. you can get the current record with Me.Form.CurrentRecord but that's
probably not the route you want to take.

You probably want to open your 2nd form filtered by the key value from the
current form.
 

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

Top