Re: Subform help please

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Now Im TotallyConfused. You are calling a form that is bound to a table
that has
a fieldID. There should be only one record that has that distinct fieldID.
If not, then you must have a form that has a fieldID that is not the primary
key? You can use AND to add parameters to your search.
"FieldID= " & me.fieldID " AND otherID = " & me.otherID


I have found it is good practice to separate out your criteria, like this:
Dim stDocName As String
Dim stLinkCriteria As String
stLinkCriteria = "CustomerID = "& Me!CustomerID
stDocName = "frmCustomerHistory"
'You can also add an openargs to the same formopen
event.
DoCmd.openform stDocName, , , stLinkCriteria, , ,"someOpenArgument"


"TotallyConfused" <TotallyConfused@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:9724D4C2-ECA9-4205-AC37-EE244CF7FA7F@xxxxxxxxxxxxxxxx
Thank you for responding. I have changed to "where argument". However,
how
do I write to include to more fields that need to be added so that when my
form opens it points to the correct one. Can more fields be added to
this?
How?

"Damon Heron" wrote:

Why not use the where argument instead of OpenArgs?

DoCmd.openform "frm_myform", , , "[FieldID] = " & Me.[FieldID]

Damon

"TotallyConfused" <TotallyConfused@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:C6A422B7-5221-4776-9E8D-251A7D949ADB@xxxxxxxxxxxxxxxx
I have main form and subform. In my subform, I want to call another
form
for
data entry when I click on one of the fields in the subform. It is
working
fine by bringing up the form but with no data. Can someone please help
me
why I am not getting any data? This is the event I have on the form
that
is
beign called from the subform's field.

Private Sub Field_ID_Click()
DoCmd.OpenForm "frm_myform", , , , OpenArgs:="[Field ID]='" &
Me![Field
ID] & "'"
End Sub

Thank you.





.



Relevant Pages

  • Re: Reading binary files of irregular format with TMemoryStream
    ... I check the bytes for characters by copying from one string to another, ... FieldId: word; ... FieldStrIn, FieldStrOut: string; ... FS:= TFileStream.Create(FPN, fmOpenRead or {fmSharCompat or} ...
    (comp.lang.pascal.delphi.misc)
  • Re: Writing Binary Files with TFileStream
    ... var fid: Word; l: Byte; fieldid, value: String; FS: TFileStream; try ... fmOpenRead or fmShareDenyNone); tData.Clear; while do begin ...
    (comp.lang.pascal.delphi.misc)
  • Re: URGENT: Access Crash after System Update!
    ... Private Sub cmdFormulationZoom_Click ... Dim stDocName As String ... Dim stLinkCriteria As String ...
    (microsoft.public.access.formscoding)
  • RE: button VS drop down
    ... Private Sub TR_PROBLEMCODESUFFIX_AfterUpdate ... Dim stDocName As String ... Dim stLinkCriteria As String ...
    (microsoft.public.access.formscoding)
  • Re: Enable/Disable Text Fields
    ... This is the code I have associated with the "Approve" Button: ... Private Sub Command108_Click ... Dim stDocName As String ... Dim stLinkCriteria As String ...
    (microsoft.public.access.formscoding)