Command button in datasheet form ?

novoiceleft

Registered User.
Local time
Today, 23:14
Joined
Jul 4, 2004
Messages
65
In one of my forms (which is a datasheet) I want to create a hyperlink or a command button (in each row), which enables the user to jump to another form (determined by the cell contents).

I have achieved that by replacing my datasheet with a continuous form and adding a command button. But I would much rather keep my datasheet format.

I tried to put a command button into the datasheet, but it won't display it.

Is it possible to achieve my objective here ? I am not having much joy with HELP.

NoVoiceLeft
 
I don't think you can put a command button in a datasheet but you can put the code in the double-click event of one of the controls to get the desired result.
 
Thanks for the advice - I would like to do what you describe.

But I am a beginner - I can't do code !! But I am very good at working out how to do things, once people have shown me here !

What I want to achieve is the following.

A user will be in a datasheet form and looking at a particular row of it. At this point, in a particular cell, the user would like to jump to another form by double clicking in that cell. So my code must then open the new form at the record related to the double clicked cell.

NoVoiceLeft
 
Can anyone help me with the short bit of code I need for this ?

I'd be soooooooooooo grateful !

NoVoiceLeft
 
Use something like this...

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Name_Of_Form_you_want _to_open"

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


...put it into the click or double-click event

change the [Invoice_ID] to the name of the controls you want to link
 
Last edited:

Users who are viewing this thread

Back
Top Bottom