Sub Form (child) Query issue (1 Viewer)

GaryPanic

Smoke me a Kipper,Skipper
Local time
Today, 13:24
Joined
Nov 8, 2005
Messages
3,212
Hi Guys

I am embarking on a new database
I have a main form and a subform/child form that is different for each type of business (see below)

form filter is on main...
If Me.FormFilter = "0" Then
Me.FormLoadX.SourceObject = "NoSchemeSelectedfrm"
End If
If Me.FormFilter = "1" Then
Me.FormLoadX.SourceObject = "TravelQfrm"
End If
If Me.FormFilter = "2" Then

Me.FormLoadX.SourceObject = "OrgQuotefrm"


End If

Now i have cascading combo box (on the child/subform) and I will have a few of these and others that will need to query stuff
the first box works correctly but the second box is not being requeried

as I have only just started this process, I am sure that some of the other qry's I will add on will have the same issue

how do I get the second dropdown/combo box to requery ? look at the first combobox ?



The first dropdown - looks at an table get categories the second should use this result to filter out and allow me to select
first part works second part does not ....
 

Ranman256

Registered User.
Local time
Today, 16:24
Joined
Apr 9, 2015
Messages
3,638
assuming me.formfilter IS a string:

Code:
SELECT CASE  Me.FormFilter
   case "0"
      Me.FormLoadX.SourceObject = "NoSchemeSelectedfrm"

   case "1"
      Me.FormLoadX.SourceObject = "TravelQfrm"

   case  "2" 
      Me.FormLoadX.SourceObject = "OrgQuotefrm"

End select
 

GaryPanic

Smoke me a Kipper,Skipper
Local time
Today, 13:24
Joined
Nov 8, 2005
Messages
3,212
thanks - however, that's not the problem
the problem is the queries /queries are not working on the sub/child forms..
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 21:24
Joined
Jul 9, 2003
Messages
12,088
My guess is that the issue of the combo boxes in the subform is not related to be form being a subform.

In other words, open the subform as a stand-alone form and get the combo box's working OK.

If the combo boxes are dependent on information from the main form or even other subforms, then please explain.

Sent from Newbury UK
 

GaryPanic

Smoke me a Kipper,Skipper
Local time
Today, 13:24
Joined
Nov 8, 2005
Messages
3,212
THat's right - stand alone fine - child /sub is the issue - what I will do is trim d/b and upload

uploaded..
 

Attachments

  • New System.accdb
    1.9 MB · Views: 7
Last edited:

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 21:24
Joined
Jul 9, 2003
Messages
12,088
THat's right - stand alone fine - child /sub is the issue - what I will do is trim d/b and upload
Either I have not understood your issue, or you have not read my question.

I don't think you read my question. Do you want to read it again and make a further reply?

Sent from Newbury UK
 

GaryPanic

Smoke me a Kipper,Skipper
Local time
Today, 13:24
Joined
Nov 8, 2005
Messages
3,212
Sorry
they are cascading combo boxs

the first selects from a table the second should be filtered by the first selection- fine as a stand alone but once a sub/child form -
does not work

i have tried various options
updating a field on the underlying table and using this as a filter for the second combobox
that didn't work ..
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 21:24
Joined
Jul 9, 2003
Messages
12,088
If it works ok when it is stand-alone, but then does not work when you use it as a subform, on another form, then this would point to a change in the record source when it becomes a subform.

When you place a form on another form, when it becomes a subform, then MS Access will automatically link the subform to a record on the main form.

This will result in a limit on the records available to the subform and could well be why your combo box is no longer working.

To test this find the the subform/subreport control (this is a square frame around your subform) your subform is in essence just a form, but it is contained within a subform/subreport control and it is this subform/subreport control that provides the link between the two forms.

Look at the subform/subreport controls properties and you will see some properties which establish a child/parent link. Clear these out, save the form and see if you still have problem.

Make a backup first!!!!

Sent from Newbury UK
 
Last edited:

GaryPanic

Smoke me a Kipper,Skipper
Local time
Today, 13:24
Joined
Nov 8, 2005
Messages
3,212
I will give this a try later on today /tonigh

How is sunny Newbury
 

CJ_London

Super Moderator
Staff member
Local time
Today, 21:24
Joined
Feb 19, 2013
Messages
12,569
took a look at your uploaded db and cannot see where the problem is - no code, no controls called FormLoadX or formfilter. Can't even find a form with a subform

So unable to help
 

GaryPanic

Smoke me a Kipper,Skipper
Local time
Today, 13:24
Joined
Nov 8, 2005
Messages
3,212
weird ..

this works
form filter is on main...
If Me.FormFilter = "0" Then
Me.FormLoadX.SourceObject = "NoSchemeSelectedfrm"
End If
If Me.FormFilter = "1" Then
Me.FormLoadX.SourceObject = "TravelQfrm"
End If
If Me.FormFilter = "2" Then

Me.FormLoadX.SourceObject = "OrgQuotefrm


However when you go to the second record(12345) and on the endorsement tab there are two combo boxes the first one works the second one does not
 

Users who are viewing this thread

Top Bottom