I am trying to speed up my item master update process. Currently if the item number is not in the table I have to look up the new GSort number and copy and past it into the table. Ya I know! w
Table Name: 350_ITest
Vendor Item Field: ISort
Company ITem Field: GSort
Unbound Lookup field on Form: Date2
Append Query: 350_ITest Query: It takes the value in Date2 and finds the Max Gsort+1 then appends to 350_Test table.
Master form:350_ItemF01
Sub Form 1: 350_ItemF02 - Connected to Date2
Sub Form 2: 350_ItemF03 - Connected to ISort field in Sub Form 1
So When I hit enter after keying in the ISort in Date2 the cursor moves to Sub Form 1 where the data in Date2 is in the Isort field. I have put the code in the GSort gotfocus event on Sub Form 1 so when I tab to the GSort field the code goes.
This is the code. I am better with Queries and Macros so I struggle with VBA. If there is a quicker way to do this in VBA I am all ears. I'll figure it out.
Private Sub GSort_GotFocus()
If IsNull(Me.GSort) Then ' ISort keyed and GSort is null Then
DoCmd.SetWarnings False
DoCmd.OpenQuery "350_ITest Query" 'Append ISort and GSort to Table.
DoCmd.RunCommand acCmdRefreshPage 'Hopped it would update Sub Form 1. Tried me.Refesh did not work either.
DoCmd.GoToControl "Description" 'Move to next update field to key in product description.
DoCmd.SetWarnings True
End If
End Sub
Currently, the code runs and moves cursor to Description field but does not show GSort. When I try to move off of the record it says
I cannot because there is now GSort Value. When I close the form after many error messages. The New ISort and GSort numbers are there.
Anyone have any ideas that could help me out?
Thanks in Advance!!