Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / March 2007

Tip: Looking for answers? Try searching our database.

Which row?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pat Backowski - 06 Mar 2007 16:56 GMT
Hi Everyone,

I have a form, listing Invoice Header data. One Invoice per line. On each
line is a button "Select".  When the user presses that button, I want to call
another form and show all the invoice data.  

How do I pass the Invoice Number , as displayed, from the row that the user
selected (pressed "Select" on).

Thanks in advance for all your kind help,
Pat.
Carl Rapson - 07 Mar 2007 16:26 GMT
You don't say if this is a Continuous form. If it is, you can just refer to
the Invoice Number field directly, as the form knows which is the current
record. Something like:

DoCmd.OpenForm "form name",,,"[Invoice Number]=" & Me.txtInvoiceNumber

Of course, I don't know the name of your form, fields and controls, so
you'll need to put in your own names there. This assumes the form you're
opening is bound to the invoice data table; what you're doing is adding a
WHERE clause to the form's RecordSource when it opens, displaying only the
Invoice Number you're interested in.

If the form isn't bound to the invoice table, you can instead pass the
invoice number in the OpenArgs parameter of OpenForm and set the form's
RecordSource in the Form_Load event, using the passed invoice number.

HTH,

Carl Rapson

> Hi Everyone,
>
[quoted text clipped - 9 lines]
> Thanks in advance for all your kind help,
> Pat.
Pat Backowski - 20 Mar 2007 11:45 GMT
Hi Carl,

Thanks for your most helpfull comments.  Yes, its a continuous form and in
the form properties, the data source is the Visit Header table.  The "key" of
the table is "Visit_Key".  When I click the "View Visit" button (where I call
another form to show the detail), I get a compile error "Method or Data
Member not found"  indicating it doesn't like Me.Visit_Key.
I've tried doing a Me.Visit_Key.SetFocus first and that just moves the error.

Private Sub Command14_Click()
On Error GoTo Err_Command14_Click
   Me.Visit_Key.SetFocus
DoCmd.OpenForm "One Visit", , , "[Log_Visit_Key]=" & Me.Visit_Key
Exit_Command14_Click:
   Exit Sub
Err_Command14_Click:
   MsgBox Err.Description
   Resume Exit_Command14_Click
End Sub
Pat Backowski - 20 Mar 2007 12:34 GMT
Hi Carl,

Please disregard the last note - I got it - my problem was the most simple
of access errors - modifying the table after creating the form - you'd think
I'd know better by now -

Many Thanks for your kind help - I'm flying

Pat Backowski
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.