Select Record?

Kelsey

Registered User.
Local time
Yesterday, 22:28
Joined
Aug 17, 2011
Messages
18
Hi,
I have a subform Where you can choose InventoryID (2nd sub automatically shows records related to that InventoryID), and then select the correct PurchaseOrderDetailID.
The 2nd sub shows only instances of that InventoryID and when you select the PurchaseOrderDetailID in the first subform, I want that record in the 2nd sub to be selected as well.
 
I thought you said that subform 2 shows instanceS of subform 1? So what's the point of highlighting them all?
 
Sorry that was a bad choice of words. What happens is in sub1 you choose an InventoryID and the bottom subform pulls up a list of all the different batches of that InventoryID that we have. For example..

Batch Qty
2301 5
2380 15

In sub1, you are also required to enter in a Batch number. Default is the first one on the list, but there are special circumstances where you may need to select a different one. I have this code currently.

Private Sub IssueQuantity_BeforeUpdate(Cancel As Integer)
If Me.IssueQuantity > Me.Parent!FifoStock!OnHand Then
Cancel = True
MsgBox "Do not have enough" & vbNewLine & vbNewLine & "Field not updated", vbExclamation, "Invalid Entry"
End If
End Sub

But, if you DO choose a BatchID that is not the top one, the bottom subform doesn't know that you switched ID's to the 2nd on the list. So if I typed in Batch 2380 and tried to issue 6, it would tell me that I don't have enough.
 
So what is your question? I would have thought your problem is synchronising sub1 with sub2 based on the selections in sub1.

Is that not the field that links both subforms?
 
My 2 subs are linked by part number.

I have uploaded a version of the database. frmIssue is the one in question, I have it opening up right away. InventoryID in use is 001-2250. After you enter a Batch ID after the Item, I want that record to also be selected on the bottom, but still showing all the related records. Basically, I want the code in the before update of Issue Quantity to be working properly. Thank you.
 

Attachments

See attached. What you actually wanted is for it to GO TO the record, not highlight or select the record.

If you still want the highlighting part, uncomment the two lines of code in the After Update event of PurchaseOrderDetail.
 

Attachments

Users who are viewing this thread

Back
Top Bottom