Simple I think

K

Kennedypd

I have a form that comes from a query listing all finance contracts a client
has. These are displayed in datasheet view. All the contracts have a unique
reference number displayed in the datasheet. I want users to be able to click
on this reference number and it to open up the form that displays all the
details about that contract. Seems simple and I am sure that I am missing
something but it has me stumped at present. Any help much appreciated.

Paul
 
C

CY

You go to the field properties and set a "On Click" event. Then you can
either write code to open the details form based on the [forms]![your form
name]![your field name] from the original form or create a simple macro that
opens the form...if you need more help let me know...
 
K

Ken Sheridan

Paul:

In the Click event procedure of the reference number control on your
datasheet view form put code along these lines:

Dim strCriteria As String

strCriteria = "[RefenceNumber] = " & Me.[ReferenceNumber]

DoCmd.OpenForm "frmContractDetails", _
WhereCondition:=strCriteria, _
WindowMode:=acDialog

where RefenceNumber is the name of the field in question and
frmContractDetails is the name of a form to show the detailed contract data.
Opening the form in dialogue window mode means that the user has to close (or
at least hide) the detailed form before returning to the datasheet view form.

The above assumes that the RefenceNumber field is of number data type. If
its text data type wrap the value in quotes:

strCriteria = "[RefenceNumber] = """ & Me.[ReferenceNumber] & """"

Ken Sheridan
Stafford, England
 
K

Kennedypd

Thank you very much for your quick respone and help. I have got there after a
bit of playing around and can now move on to the next set of issues.

Cheers

Ken Sheridan said:
Paul:

In the Click event procedure of the reference number control on your
datasheet view form put code along these lines:

Dim strCriteria As String

strCriteria = "[RefenceNumber] = " & Me.[ReferenceNumber]

DoCmd.OpenForm "frmContractDetails", _
WhereCondition:=strCriteria, _
WindowMode:=acDialog

where RefenceNumber is the name of the field in question and
frmContractDetails is the name of a form to show the detailed contract data.
Opening the form in dialogue window mode means that the user has to close (or
at least hide) the detailed form before returning to the datasheet view form.

The above assumes that the RefenceNumber field is of number data type. If
its text data type wrap the value in quotes:

strCriteria = "[RefenceNumber] = """ & Me.[ReferenceNumber] & """"

Ken Sheridan
Stafford, England

Kennedypd said:
I have a form that comes from a query listing all finance contracts a client
has. These are displayed in datasheet view. All the contracts have a unique
reference number displayed in the datasheet. I want users to be able to click
on this reference number and it to open up the form that displays all the
details about that contract. Seems simple and I am sure that I am missing
something but it has me stumped at present. Any help much appreciated.

Paul
 

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