By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,027 Members | 1,273 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,027 IT Pros & Developers. It's quick & easy.

Release Value of Find First?

P: n/a
--------------------------------------------------------------------------------

I have a subform with the related IDs for each customer on the
customer main form.

I have a button on the continuous subform, which will make the main
customer record go to that sub related record's customer record.
(follow me?)

Problem is that once I am at the related record, if I push the button
again, it won't go back to the master record. Once you go to a
customer's related record, the related subform shows the master record
as related. This way, you can get back to it. When I stop the code,
it has the value still equaling the related ID, and isn't releasing
that value.

Do you know how I release the value in this code?
Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdGoToRelated_Click()
  2. With Me.Parent.RecordsetClone
  3. .FindFirst "ID=" & Me!RelatedMID
  4. If .NoMatch Then
  5. MsgBox "Funny - I should be able to find that person but I
  6. can't"
  7. Else
  8. Me.Parent.Bookmark = .Bookmark
  9. End If
  10.  
  11. DoCmd.Requery tblRelated_subform
  12.  
  13. Me.Parent.cmbCustomer.SetFocus
  14.  
  15. End With
  16.  
  17. End Sub
  18.  

Thanks for any help!

Aug 16 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Since I haven't gotten any responses, I will try to re-explain the
situation:

I have this cross reference table.

It has the following:

CID cross reference PK
CustomerNumber - the customer's number
RelatedCustomerNumber - the numbers related to that customer number
RelatedID - the Customer PK for the related number (so that you can
find them on the entry form)

So, on the main customer entry form, there is a combo box, where you
can type or scroll and select a customer number.

I now also have a related subform, to show related records.

This button should let you choose a related record to go to. The
customer combo cmbCustNum, has a row source query of the Customer PK
and CustomerNumber. It shows the CustomerNumber, but is tied to the
Customer PK.

I need that combo button to take me to a related record on the main
form. Once I am there, I need to be able to go to any related record
(including back to the one I came from) that exist on the sub related
form for that customer.

Make sense?

Thank you for any help that you can give.

Aug 17 '07 #2

P: n/a
"no****@thankyou.com" <mi*****@yahoo.comwrote in
news:11**********************@j4g2000prf.googlegro ups.com:
Since I haven't gotten any responses, I will try to re-explain
the situation:

I have this cross reference table.

It has the following:

CID cross reference PK
CustomerNumber - the customer's number
RelatedCustomerNumber - the numbers related to that customer
number RelatedID - the Customer PK for the related number (so
that you can find them on the entry form)

So, on the main customer entry form, there is a combo box,
where you can type or scroll and select a customer number.

I now also have a related subform, to show related records.

This button should let you choose a related record to go to.
The customer combo cmbCustNum, has a row source query of the
Customer PK and CustomerNumber. It shows the CustomerNumber,
but is tied to the Customer PK.

I need that combo button to take me to a related record on the
main form. Once I am there, I need to be able to go to any
related record (including back to the one I came from) that
exist on the sub related form for that customer.

Make sense?
No. There is no such control as a combobutton. there are
comboboxes and there are commandbuttons.

I think what you want to do is click on a button in the subform
and have the mainform move to the selected record. Is that
right?

If yes, and the combobox currently correctly lets you choose the
desired record, all you need is for the onclick event of the
subform, set the new value of the combobox.

Parent.cmbCustNum = me.PrimaryKey
is the code to set the new value.

You may also need to trigger the combo box afterUpdateEvent
after setting the new value.

CALL cmbCustNum_afterUpdate

You will need to change the

private sub cmbCustNum_afterUpdate
to
public sub .cmbCustNum_afterUpdate

in the parent form to make it accessible to the subform.
Thank you for any help that you can give.
I Hope I've helped.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Aug 17 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.