dbTalk Databases Forums  

Shoule be Easy!!

comp.databases.ms-access comp.databases.ms-access


Discuss Shoule be Easy!! in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
sara
 
Posts: n/a

Default Shoule be Easy!! - 04-17-2009 , 03:59 PM






I am losing my mind! I've been away from Access for several months
and a friend just asked for some help. I can't get it!

She wants to
1. Choose a Name and License Number from a drop-down (Have it:
cboCheckName)
2. Once the name is chosen, show ALL the records from the same table,
that have a match for Name and LicenseNumber.

She has a Form with cboCheckName on it: frmPayments
And a subform on the form sfrmPayments

I put the following code into AfterUpdate of the combo box:

Private Sub cboCheckName_AfterUpdate()

' FILL the subform with checks for the person selected

Dim rs As Object
Set rs = Me.Recordset.Clone

rs.FindFirst "[CheckName] =" & Me.cboCheckName & _
" And [LicAcctNum] = " & (Me.cboCheckName.Column(1))

Me.Bookmark = rs.Bookmark

rs.Close

End Sub

On rs.FindFirst, I get "Object doesn't support this property or
method".

WHAT is wrong? This should be so simple!

thank you -
Sara


Reply With Quote
  #2  
Old   
Salad
 
Posts: n/a

Default Re: Shoule be Easy!! - 04-17-2009 , 04:23 PM






sara wrote:

Quote:
I am losing my mind! I've been away from Access for several months
and a friend just asked for some help. I can't get it!

She wants to
1. Choose a Name and License Number from a drop-down (Have it:
cboCheckName)
2. Once the name is chosen, show ALL the records from the same table,
that have a match for Name and LicenseNumber.

She has a Form with cboCheckName on it: frmPayments
And a subform on the form sfrmPayments

I put the following code into AfterUpdate of the combo box:

Private Sub cboCheckName_AfterUpdate()

' FILL the subform with checks for the person selected

Dim rs As Object
Set rs = Me.Recordset.Clone

rs.FindFirst "[CheckName] =" & Me.cboCheckName & _
" And [LicAcctNum] = " & (Me.cboCheckName.Column(1))

Me.Bookmark = rs.Bookmark

rs.Close

End Sub

On rs.FindFirst, I get "Object doesn't support this property or
method".

WHAT is wrong? This should be so simple!

thank you -
Sara

You have frmPayments and sfrmPayments. I have no idea how you present
the data. Is 1 a single rec form, the other continous or datasheet?

Look at Filter

Me.Filter = "CheckName =" & Me.cboCheckName & _
" And [LicAcctNum] = " & (Me.cboCheckName.Column(1))
Me.FilterOn = True




Reply With Quote
  #3  
Old   
saraqpost@yahoo.com
 
Posts: n/a

Default Re: Shoule be Easy!! - 04-17-2009 , 05:46 PM



On Apr 17, 5:23*pm, Salad <o... (AT) vinegar (DOT) com> wrote:
Quote:
sara wrote:
I am losing my mind! *I've been away from Access for several months
and a friend just asked for some help. *I can't get it!

She wants to
1. *Choose a Name and License Number from a drop-down (Have it:
cboCheckName)
2. *Once the name is chosen, show ALL the records from the same table,
that have a match for Name and LicenseNumber.

She has a Form with cboCheckName on it: *frmPayments
And a subform on the form *sfrmPayments

I put the following code into AfterUpdate of the combo box:

Private Sub cboCheckName_AfterUpdate()

' *FILL the subform with checks for the person selected

* * *Dim rs As Object
* * *Set rs = Me.Recordset.Clone

* * rs.FindFirst "[CheckName] =" & Me.cboCheckName & _
* * " And [LicAcctNum] = " & (Me.cboCheckName.Column(1))

* * Me.Bookmark = rs.Bookmark

* * rs.Close

End Sub

On rs.FindFirst, I get "Object doesn't support this property or
method".

WHAT is wrong? *This should be so simple!

thank you -
Sara

You have frmPayments and sfrmPayments. *I have no idea how you present
the data. *Is 1 a single rec form, the other continous or datasheet?

Look at Filter

* * * * Me.Filter = "CheckName =" & Me.cboCheckName & _
* * * " And [LicAcctNum] = " & (Me.cboCheckName.Column(1))
* * * * Me.FilterOn = True- Hide quoted text -

- Show quoted text -
Thanks -
The form is just the combo box and the subform on it.
The subform is Continuous records - linked to the Checkname and
License Number chosen in the Combo Box.

When you say "Look at filter" - do I put that in the After Update
event? Or does it go on the form somehow?

Sara


Reply With Quote
  #4  
Old   
Salad
 
Posts: n/a

Default Re: Shoule be Easy!! - 04-17-2009 , 07:38 PM



saraqpost (AT) yahoo (DOT) com wrote:

Quote:
On Apr 17, 5:23 pm, Salad <o... (AT) vinegar (DOT) com> wrote:

sara wrote:

I am losing my mind! I've been away from Access for several months
and a friend just asked for some help. I can't get it!

She wants to
1. Choose a Name and License Number from a drop-down (Have it:
cboCheckName)
2. Once the name is chosen, show ALL the records from the same table,
that have a match for Name and LicenseNumber.

She has a Form with cboCheckName on it: frmPayments
And a subform on the form sfrmPayments

I put the following code into AfterUpdate of the combo box:

Private Sub cboCheckName_AfterUpdate()

' FILL the subform with checks for the person selected

Dim rs As Object
Set rs = Me.Recordset.Clone

rs.FindFirst "[CheckName] =" & Me.cboCheckName & _
" And [LicAcctNum] = " & (Me.cboCheckName.Column(1))

Me.Bookmark = rs.Bookmark

rs.Close

End Sub

On rs.FindFirst, I get "Object doesn't support this property or
method".

WHAT is wrong? This should be so simple!

thank you -
Sara

You have frmPayments and sfrmPayments. I have no idea how you present
the data. Is 1 a single rec form, the other continous or datasheet?

Look at Filter

Me.Filter = "CheckName =" & Me.cboCheckName & _
" And [LicAcctNum] = " & (Me.cboCheckName.Column(1))
Me.FilterOn = True- Hide quoted text -

- Show quoted text -


Thanks -
The form is just the combo box and the subform on it.
The subform is Continuous records - linked to the Checkname and
License Number chosen in the Combo Box.

When you say "Look at filter" - do I put that in the After Update
event? Or does it go on the form somehow?

Sara
I'd probably put it in the AfterUpdate event of the combo. But since
you are filtering a subform...
Forms!MainFormName!SubFormName.Form.Filter = "CheckName = " &
Me.cboCheckName & " And [LicAcctNum] = " & (Me.cboCheckName.Column(1))
Forms!MainFormName!SubFormName.Form.FilterOn = True

Remember, strings are surrounded by quotes, numerics by themselves,
dates with #. Yours is surrounded like a numeric. You could do a
msgbox Forms!MainFormName!SubFormName.Form.Filter
to see what the filter currently is. You might have to add some more
quote marks.

For example, you might end up with
"CheckName = BOA"
and you want it to look like
"CheckName = "BOA""



Reply With Quote
  #5  
Old   
jovi07@verizon.net
 
Posts: n/a

Default Re: Shoule be Easy!! - 04-17-2009 , 10:09 PM



Why are you using any code at all? It seems like there is something
wrong in your form/subform design. I use subforms and the filtering
is done automatically. I have a customer combo box on the main form
and all customer payments in the subform. The subform is linked to the
main form by the customer number. No records are shown in the subform
until a Customer is selected from the combo box. Every time a
different customer is selected the corresponding payment records are
shown in the subform.




Reply With Quote
  #6  
Old   
Roger
 
Posts: n/a

Default Re: Shoule be Easy!! - 04-18-2009 , 07:57 AM



On Apr 17, 4:46*pm, "saraqp... (AT) yahoo (DOT) com" <saraqp... (AT) yahoo (DOT) com> wrote:
Quote:
On Apr 17, 5:23*pm, Salad <o... (AT) vinegar (DOT) com> wrote:





sara wrote:
I am losing my mind! *I've been away from Access for several months
and a friend just asked for some help. *I can't get it!

She wants to
1. *Choose a Name and License Number from a drop-down (Have it:
cboCheckName)
2. *Once the name is chosen, show ALL the records from the same table,
that have a match for Name and LicenseNumber.

She has a Form with cboCheckName on it: *frmPayments
And a subform on the form *sfrmPayments

I put the following code into AfterUpdate of the combo box:

Private Sub cboCheckName_AfterUpdate()

' *FILL the subform with checks for the person selected

* * *Dim rs As Object
* * *Set rs = Me.Recordset.Clone

* * rs.FindFirst "[CheckName] =" & Me.cboCheckName & _
* * " And [LicAcctNum] = " & (Me.cboCheckName.Column(1))

* * Me.Bookmark = rs.Bookmark

* * rs.Close

End Sub

On rs.FindFirst, I get "Object doesn't support this property or
method".

WHAT is wrong? *This should be so simple!

thank you -
Sara

You have frmPayments and sfrmPayments. *I have no idea how you present
the data. *Is 1 a single rec form, the other continous or datasheet?

Look at Filter

* * * * Me.Filter = "CheckName =" & Me.cboCheckName & _
* * * " And [LicAcctNum] = " & (Me.cboCheckName.Column(1))
* * * * Me.FilterOn = True- Hide quoted text -

- Show quoted text -

Thanks -
The form is just the combo box and the subform on it.
The subform is Continuous records - linked to the Checkname and
License Number chosen in the Combo Box.

When you say "Look at filter" - do I put that in the After Update
event? *Or does it go on the form somehow?

Sara- Hide quoted text -

- Show quoted text -
I don't think you need any code
on your main form, add another field called LicenseNbr and set its
source to
=cboCheckName.column(1)

and set both the master / child links to your subform to
cboCheckName, licenceNbr

when you choose a name, the licenseNbr will be displayed on the main
form
and the payments will be displayed on the subform


Reply With Quote
  #7  
Old   
saraqpost@yahoo.com
 
Posts: n/a

Default Re: Shoule be Easy!! - 04-18-2009 , 10:03 PM



On Apr 18, 8:57*am, Roger <lesperan... (AT) natpro (DOT) com> wrote:
Quote:
On Apr 17, 4:46*pm, "saraqp... (AT) yahoo (DOT) com" <saraqp... (AT) yahoo (DOT) com> wrote:





On Apr 17, 5:23*pm, Salad <o... (AT) vinegar (DOT) com> wrote:

sara wrote:
I am losing my mind! *I've been away from Access for several months
and a friend just asked for some help. *I can't get it!

She wants to
1. *Choose a Name and License Number from a drop-down (Have it:
cboCheckName)
2. *Once the name is chosen, show ALL the records from the same table,
that have a match for Name and LicenseNumber.

She has a Form with cboCheckName on it: *frmPayments
And a subform on the form *sfrmPayments

I put the following code into AfterUpdate of the combo box:

Private Sub cboCheckName_AfterUpdate()

' *FILL the subform with checks for the person selected

* * *Dim rs As Object
* * *Set rs = Me.Recordset.Clone

* * rs.FindFirst "[CheckName] =" & Me.cboCheckName & _
* * " And [LicAcctNum] = " & (Me.cboCheckName.Column(1))

* * Me.Bookmark = rs.Bookmark

* * rs.Close

End Sub

On rs.FindFirst, I get "Object doesn't support this property or
method".

WHAT is wrong? *This should be so simple!

thank you -
Sara

You have frmPayments and sfrmPayments. *I have no idea how you present
the data. *Is 1 a single rec form, the other continous or datasheet?

Look at Filter

* * * * Me.Filter = "CheckName =" & Me.cboCheckName & _
* * * " And [LicAcctNum] = " & (Me.cboCheckName.Column(1))
* * * * Me.FilterOn = True- Hide quoted text -

- Show quoted text -

Thanks -
The form is just the combo box and the subform on it.
The subform is Continuous records - linked to the Checkname and
License Number chosen in the Combo Box.

When you say "Look at filter" - do I put that in the After Update
event? *Or does it go on the form somehow?

Sara- Hide quoted text -

- Show quoted text -

I don't think you need any code
on your main form, add another field called LicenseNbr and set its
source to
* *=cboCheckName.column(1)

and set both the master / child links to your subform to
* *cboCheckName, licenceNbr

when you choose a name, the licenseNbr will be displayed on the main
form
and the payments will be displayed on the subform- Hide quoted text -

- Show quoted text -
THANK YOU, Roger!! I knew it had to be easy and (not for the first
time) I made it too complicated.

You were exactly right and it works like a charm.....many thanks!

Sara


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.