Re: Subform help please
- From: "Damon Heron" <damon_188327@xxxxxxxxxxx>
- Date: Tue, 14 Jul 2009 14:16:47 -0700
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.
.
- References:
- Subform help please
- From: TotallyConfused
- Re: Subform help please
- From: Damon Heron
- Re: Subform help please
- From: TotallyConfused
- Subform help please
- Prev by Date: Re: On Dirty style event for all pages of a tab control
- Next by Date: Re: Cancel
- Previous by thread: Re: Subform help please
- Next by thread: Type mismatch in JOIN expression. (Error 3615)
- Index(es):
Relevant Pages
|