I currently have an Access form that gets weight data from a scale when the user presses the scale's Print button. I am using Winwedge software to allow the scale to insert data into Access fom.
Winwedge is calling a macro to run the following function:
' Declare variables
Dim ChannelNumber, MyData As Variant
' open a link to WinWedge
ChannelNumber = DDEInitiate("WinWedge", "Com1")
' get data from field(1)
MyData = DDERequest(ChannelNumber, "FIELD(1)")
' terminate the link
' if no data then quit
If Len(MyData) = 0 Then Exit Function
'Data from Field(1) in WinWedge is now in the variable "MyData". The following code sets
'the value of Textbox1 on Form1 to display the current WinWedge data.
Forms!T1DryweightForm!textbox1.Text = MyData
Here is the vb code that is run when data is placed in a textbox1 on my Access form:
Private Sub textbox1_AfterUpdate()
On Error GoTo ProcError
Me![CavityDataSubfrm].Form!Wt = textbox1.Value
DoCmd.GoToRecord , , acNext ' Do Something for each record
Select Case Err.Number
MsgBox "That's the last Cavity in the list. Click Save Cavity Data button.", _
vbInformation, "End of the list..."
MsgBox "Error " & Err.Number & ": " & Err.Description, , _
"Error in NextPP_Click procedure..."
The above code dumps data into the Wt field, then moves to the next record's wt field until it reaches the end and the message " That's the last Cavity in the list. Click Save Cavity Data button." displays. I need to dump data into a Wt field, and automatically move cursor to the right to dump data. I need to move to insert data in 4 horizontal fields for one record and then go to the next record and insert 4 fields again til the end of the list. Let me know if you need more info. Any help would be greatly appreciated.
Inline Plastics I.T. Dept.