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 / Reports / Printing / February 2006

Tip: Looking for answers? Try searching our database.

Filter SubForm Continuos form from Main Form combo box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DMUM - 27 Feb 2006 20:09 GMT
Hello, I've been searching most of the morning trying to find anything within
the forum and outside of the forum that would help me with this.  

I have a Main form called - Run_import
I have a sub form called - PRSAdef_New

On my Main form, I am trying to use a combo box to filter the underlying
continuous form recordsource.  Here is my code:

Set frm = Form_Run_Import

If IsNull(Me.cboPRSAType) Then
  frm.RecordSource = "Test"
Else
  Me!frmPRSADef_New.Form.Filter = "PRSAType = '" & Me!txtPRSAType & "'"
  Me!frmPRSADef_New.Form.FilterOn = True
End If
End Sub

I keep getting a popup message that asks for thr value of PRSAType.  I've
tried other combinations of code that seem to work because I get no error,
but the data in the continuos form does not update based on the selection
from the combo box.  I've created filters before, but not using a subform, so
if someone could please give me the necessary syntax, I'd really appreciate
it.

Thanks

Deborah
DMUM - 27 Feb 2006 20:11 GMT
>Hello, I've been searching most of the morning trying to find anything within
>the forum and outside of the forum that would help me with this.  
[quoted text clipped - 25 lines]
>
>Deborah

By the way PRSAType is a column field on the continuous form.
Marshall Barton - 27 Feb 2006 20:34 GMT
>>Hello, I've been searching most of the morning trying to find anything within
>>the forum and outside of the forum that would help me with this.  
[quoted text clipped - 23 lines]
>
>By the way PRSAType is a column field on the continuous form.

That popup message says that PRSAType is **not** a field in
the (sub)form's record sourec table/query.  Perhaps there is
a slight varioation in the way you typed it in your VBA code
above, or maybe the field in the query is aliased to another
name???

Signature

Marsh
MVP [MS Access]

DMUM - 27 Feb 2006 20:41 GMT
>>>Hello, I've been searching most of the morning trying to find anything within
>>>the forum and outside of the forum that would help me with this.  
[quoted text clipped - 7 lines]
>above, or maybe the field in the query is aliased to another
>name???

Actually I found that out after I posted the question.  Unfortuneatly
changing it did not correct the problem.  There are only 3 fields in my query

defnum
PRSA_Definition
PRSA_Type

The query is called Test for now

The subform is called frmPRSADef_New and unless I am looking at the wrong
thing, that form name is also the same.

Any other ideas or perhaps a re-direction om my syntax.

Thank you
DMUM - 27 Feb 2006 20:43 GMT
>>>>Hello, I've been searching most of the morning trying to find anything within
>>>>the forum and outside of the forum that would help me with this.  
[quoted text clipped - 17 lines]
>
>Thank you

I canged that particular line to: Me!frmPRSADef_New.Form.Filter = "Me!
frmPRSADef_New.PRSA_Type = '" & Me!cboPRSAType & "'"

I am still getting the same error/popup
Marshall Barton - 27 Feb 2006 21:42 GMT
>>>>>Hello, I've been searching most of the morning trying to find anything within
>>>>>the forum and outside of the forum that would help me with this.  
[quoted text clipped - 20 lines]
>I canged that particular line to: Me!frmPRSADef_New.Form.Filter = "Me!
>frmPRSADef_New.PRSA_Type = '" & Me!cboPRSAType & "'"

I think the pop up prompt was probably a little different
this time.  Try this:

Me!frmPRSADef_New.Form.Filter = _
                "PRSA_Type = '" & Me!cboPRSAType & "'"

I also note that you seem to have changed the name of the
control from txtPRSAType to cboPRSAType.  Don't forget that
the value of a combo box is specified in it BoundColumn
property, which may be different from what you see in the
text portion onf the combo box.

Signature

Marsh
MVP [MS Access]

DMUM - 28 Feb 2006 13:45 GMT
Thank you so much Marshall.  I was dreading taking all day to get this to
work like I did yesterday.

Thank you!

Thank you!

>>>>>>Hello, I've been searching most of the morning trying to find anything within
>>>>>>the forum and outside of the forum that would help me with this.  
[quoted text clipped - 13 lines]
>property, which may be different from what you see in the
>text portion onf the combo box.
 
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.