Using stLinkCriteria to go to matching record

HBTCLaura

New member
Local time
Today, 08:29
Joined
May 4, 2011
Messages
8
Hi all,

I have a database that logs all of our company contacts, for the ease of use this is viewed as a form displaying the company details at the top and two subforms (one showing contact details and the other showing a commentry of conversations with said company)

To save the user from having to scroll through each single form indiviually I have set up a datasheet showing a list of companies and their basic details so that they can select what company they want and can double click on the company name to take them to the full form view.

The main form is called "Company_Details_Form"
The datasheet is called "Company_Details_Datasheet"
The field that links the two is "CompanyName"

Currently I have the following code on the on dbl click event:

Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Company_Details_Form"

stLinkCriteria = "[CompanyName]='" & Me![CompanyName] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

DoCmd.Close acForm, "Datasheet View", acSaveYes

It works, in effect. It takes me to the desired record but I am unable to scroll from there through any other records in the database, it only opens the single record.

I have a feeling I'm possibly stuck with a filter somewhere or something? It's the only thing I can think of?

I hope this is enough info and you can understand what I mean!

I am by no means an expert on this sort of stuff, I'm self teaching it all at the moment so please go easy on me!!

Any help or advice is welcomed, thank you in advance

HBTCLaura
 

Users who are viewing this thread

Back
Top Bottom