problem with unlinked subforms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

what is the appropriate way to manage an unlinked subform?

I have a tab on a form that serves as an independent search page for data.
But this page should in no way be related to whatever record is on another
tab.
So I have the Parent and child links set to None.

On this particular tab for searches, I have a combobox that I use to filter
out values and a subform is filtered based on a value in the combo box that
show the search results.

But I notice that after choosing a couple of values and seeing strange
results, that the subform actually becomes linked, to the ID field of the
form.

This is my code
================================================
Select Case Me.cmbSearchField.Value
Case "*ALL"
Me.ResultSub.Form.RecordSource = "qrySearchAll"
Me.ResultSub.Form.FilterOn = False

Case Else

Me.ResultSub.Form.RecordSource = "qrySearchAll"
Me.ResultSub.Form.Filter = "[Field Name] = '" & Me.cmbSearchField &
"'"
Me.ResultSub.Form.FilterOn = True

End Select

End Sub

===========================================
Seems pretty straightforward, but when after I select a couple of values,
the subform becomes linked...
 
jonefer said:
what is the appropriate way to manage an unlinked subform?

I have a tab on a form that serves as an independent search page for data.
But this page should in no way be related to whatever record is on another
tab.
So I have the Parent and child links set to None.

On this particular tab for searches, I have a combobox that I use to filter
out values and a subform is filtered based on a value in the combo box that
show the search results.

But I notice that after choosing a couple of values and seeing strange
results, that the subform actually becomes linked, to the ID field of the
form.

This is my code
================================================
Select Case Me.cmbSearchField.Value
Case "*ALL"
Me.ResultSub.Form.RecordSource = "qrySearchAll"
Me.ResultSub.Form.FilterOn = False

Case Else

Me.ResultSub.Form.RecordSource = "qrySearchAll"
Me.ResultSub.Form.Filter = "[Field Name] = '" & Me.cmbSearchField &
"'"
Me.ResultSub.Form.FilterOn = True

End Select

End Sub

===========================================
Seems pretty straightforward, but when after I select a couple of values,
the subform becomes linked...


Oh wow! Allen Browne and I were just talking about trying
to find a reproducible scenario for this bug.

What version of Access are you using?

Is it possible for you to strip a copy of your mdb file down
to the bare essentials that still demonstrates the problem
and send a compacted and zipped copy to me? Please say yes,
I would like to analyze it and maybe get a better
understanding of what's happening before forwarding it on to
the Access developers.

Oops, almost forgot. We think a hokey workaround might be
to set the Link Master and Child properties to ""
immediately after setting the ControlSource property.
 
Ok, I'll send it to you - how can I get it to you?

Also, what I ended up doing that fixed it was to remove the most obvious
link between the two forms. - (an ID field, but if I wanted that field, it
would have just kept doing it)

Oh, and I tried what you suggested (which I thought was hokey too)
to set the Link Master and Child properties to ""
immediately after setting the ControlSource property
- that didn't work either.

Marshall Barton said:
jonefer said:
what is the appropriate way to manage an unlinked subform?

I have a tab on a form that serves as an independent search page for data.
But this page should in no way be related to whatever record is on another
tab.
So I have the Parent and child links set to None.

On this particular tab for searches, I have a combobox that I use to filter
out values and a subform is filtered based on a value in the combo box that
show the search results.

But I notice that after choosing a couple of values and seeing strange
results, that the subform actually becomes linked, to the ID field of the
form.

This is my code
================================================
Select Case Me.cmbSearchField.Value
Case "*ALL"
Me.ResultSub.Form.RecordSource = "qrySearchAll"
Me.ResultSub.Form.FilterOn = False

Case Else

Me.ResultSub.Form.RecordSource = "qrySearchAll"
Me.ResultSub.Form.Filter = "[Field Name] = '" & Me.cmbSearchField &
"'"
Me.ResultSub.Form.FilterOn = True

End Select

End Sub

===========================================
Seems pretty straightforward, but when after I select a couple of values,
the subform becomes linked...


Oh wow! Allen Browne and I were just talking about trying
to find a reproducible scenario for this bug.

What version of Access are you using?

Is it possible for you to strip a copy of your mdb file down
to the bare essentials that still demonstrates the problem
and send a compacted and zipped copy to me? Please say yes,
I would like to analyze it and maybe get a better
understanding of what's happening before forwarding it on to
the Access developers.

Oops, almost forgot. We think a hokey workaround might be
to set the Link Master and Child properties to ""
immediately after setting the ControlSource property.
 
Send it as an attachment in an email to my address (in this
message header's From field). If your newsreader program
allows it, just reply to this message via email. I'll keep
an eye on that account for it.

I just noticed that I said ControlSource before, what I
meant to say is the RecordSource, but you probably already
figured that out. If that didn't work, how about right
after setting the Filter property? Somewhere or other
there's got to be a way to wipe out this unwanted link.

Rather than removing the field from one of the form's record
source, I think you could just rename the field (either in
the original table or as an alias in a record source query.
Another thing I want to try is to change the list of field
names that Access autoindexes (Tools - Options -
Table/Queries)

Anyway, send the mdb along and I will get back to you with
whatever I can find out about it.
--
Marsh
MVP [MS Access]

Ok, I'll send it to you - how can I get it to you?

Also, what I ended up doing that fixed it was to remove the most obvious
link between the two forms. - (an ID field, but if I wanted that field, it
would have just kept doing it)

Oh, and I tried what you suggested (which I thought was hokey too)
to set the Link Master and Child properties to ""
immediately after setting the ControlSource property
- that didn't work either.

jonefer said:
what is the appropriate way to manage an unlinked subform?

I have a tab on a form that serves as an independent search page for data.
But this page should in no way be related to whatever record is on another
tab.
So I have the Parent and child links set to None.

On this particular tab for searches, I have a combobox that I use to filter
out values and a subform is filtered based on a value in the combo box that
show the search results.

But I notice that after choosing a couple of values and seeing strange
results, that the subform actually becomes linked, to the ID field of the
form.

This is my code
================================================
Select Case Me.cmbSearchField.Value
Case "*ALL"
Me.ResultSub.Form.RecordSource = "qrySearchAll"
Me.ResultSub.Form.FilterOn = False

Case Else

Me.ResultSub.Form.RecordSource = "qrySearchAll"
Me.ResultSub.Form.Filter = "[Field Name] = '" & Me.cmbSearchField &
"'"
Me.ResultSub.Form.FilterOn = True

End Select

End Sub

===========================================
Seems pretty straightforward, but when after I select a couple of values,
the subform becomes linked...
Marshall Barton said:
Oh wow! Allen Browne and I were just talking about trying
to find a reproducible scenario for this bug.

What version of Access are you using?

Is it possible for you to strip a copy of your mdb file down
to the bare essentials that still demonstrates the problem
and send a compacted and zipped copy to me? Please say yes,
I would like to analyze it and maybe get a better
understanding of what's happening before forwarding it on to
the Access developers.

Oops, almost forgot. We think a hokey workaround might be
to set the Link Master and Child properties to ""
immediately after setting the ControlSource property.
 
Back
Top