command button 2007

  • Thread starter mugziegumz via AccessMonster.com
  • Start date
M

mugziegumz via AccessMonster.com

Brand new with access-
How can I create a command in datasheet form to open another form? Is this
possible? I tried doing the command in datasheet view/form but it didn't work.

I'd like to create a command next to each person's name. So if I clicked on
their last name in datasheet view-it'd open to a new form with lots more
detail.
Step by step instrucitons please!
 
T

Tom van Stiphout

On Wed, 26 Nov 2008 01:35:03 GMT, "mugziegumz via AccessMonster.com"

No, a form in datasheet view cannot have buttons. Use a ribbon.
Perhaps not for an absolute newbie.

If you click - I would suggest double-click - the LastName, the
LastName_DblClick event occurs. THere you can open a new form.
Something like:
docmd.OpenForm "MyNewForm",,,"PersonID=" & Me.PersonID

-Tom.
Microsoft Access MVP
 
D

Damon Heron

The easiest way is to use the double-click event on the field (person's
name)
Private Sub YourField_DblClick(cancel as integer)
Dim stDocName As String
Dim strWhere As String

stDocName = "Your Form Name"
strWhere = "[Person] = " & "'" & Me.YourField & "'"

DoCmd.OpenForm stDocName, , , strWhere

end sub

Damon
 
M

mugziegumz via AccessMonster.com

Where do I put this command? Being brand new with access-can I copy and paste
this info somewhere in my command? Thanks.
Shannon

Damon said:
The easiest way is to use the double-click event on the field (person's
name)
Private Sub YourField_DblClick(cancel as integer)
Dim stDocName As String
Dim strWhere As String

stDocName = "Your Form Name"
strWhere = "[Person] = " & "'" & Me.YourField & "'"

DoCmd.OpenForm stDocName, , , strWhere

end sub

Damon
Brand new with access-
How can I create a command in datasheet form to open another form? Is this
[quoted text clipped - 6 lines]
detail.
Step by step instrucitons please!
 

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