Update based on query????

jbphoenix

Registered User.
Local time
Today, 13:35
Joined
Jan 25, 2007
Messages
98
Here's what I'm doing - I have a series of queries that run to give me a unique number in text format. I would like that number to go into my ID field after I update the CustomerID. The CustomerID is a combobox. Is this possible? Here is the code I have to just run the query after the CustomerID is updated?

Private Sub Combo6_AfterUpdate()
On Error GoTo Err_Command8_Click

Dim stDocName As String

stDocName = "qry-RMAIDTEST2"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_Command8_Click:
Exit Sub

Err_Command8_Click:
MsgBox Err.Description
Resume Exit_Command8_Click
End Sub
 
are you trying to display the customer name based on the id that is recieved from the multiple queries?
 
Let me explain a little more -

I am creating a way to process RMA's. The table Customer_Order is a linked table from our MRP. The Order_ID is text. We need to use Access because of the unique way we ID our RMA's. An order has to be created in the MRP to process an RMA. So essentially the Order_ID is also the RMA_ID. A typical order_id looks like this - 123454, an RMA_ID is like this A4000, or C4123, or H4563. The RMA_ID has a letter in front. The RMA's need to start in the 4000 range so that's why I created another table that has the customer_number and the rma_id. I am using the Dmax function and then changing the number to text. Then I would like to use that text number in my form which in turn will go to the Customer_Order table. The other part of the process is the user has to go to our MRP and finish the process.
 
You can either use a recordset or DLookup to get the value from the query.
 
then use the after update function to add the number to the txtbox
 

Users who are viewing this thread

Back
Top Bottom