open form button

G

Guest

hi everybody
there is one Tabular Form that shows all my records and another form based
on the same tables but shows only one record at the time using a combo
box(for the surname field) .i used the button
wizard to add an open form button to the first (tabular form ) so there is a
connection between them.
i was wondering if its possible the open form button not only drive me to
the second form but to the specific record that the tabular form was
pointing at
that time.
thanks
 
G

Guest

don't use wizard,
write VBA coding by yourself, OpenForm method has few agurement on it, you
can see in help
eg. Docmd.OpenForm yourFormName,,,,

"vassilis" 來函:
 
A

Arvin Meyer [MVP]

Use the following code in an event procedure of a command button:

DoCmd.OpenForm "YourFormName",,,,"ID = " & Me.txtID

Where:

YourFormName is your form name
ID is the field name of your Primary Key
txtID is the name of the textbox on your first form that displays the
Primary Key field.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
G

Guest

im writing this on click event

DoCmd.OpenForm "atomic_FORM", , , , "ID = " & Me.ID

atomic_form is the second form and total_form is my tabular, but my primary
key consist of two fields the ID and ASM and so far im getting a <type
mismatch> message.
Ο χÏήστης "Arvin Meyer [MVP]" έγγÏαψε:
 
D

Douglas J. Steele

What data types are ID and ASM? If they're text, you need to use quotes. For
instance, the following assumes ID is numeric, and ASM is text:

DoCmd.OpenForm "atomic_FORM", , , , _
"ID = " & Me.ID & " AND ASM =" & _
Chr$(34) & Me.ASM & Chr$(34)

(Chr$(34) returns a double quote, ")


--
Doug Steele, Microsoft Access MVP

(no e-mails, 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