Not sure what you are doing..... but you could try this

dim intStrLength as integer
intStrLength =Len(MyData)

If IsNumeric(MyData) Then   ' data is all numeric data

   Select Case intStrLength   ' how long is the numeric string?

    (HERE IS WHERE IT HANGS UP)
    
    Case 4


-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] Behalf Of brazilianbound
Sent: Friday, December 09, 2005 12:34 PM
To: [email protected]
Subject: [AccessDevelopers] Method 'Item' of object 'Forms' failed




I don't know what is going on.  It was working fine.  Here is the 
Wedge code it's hanging on.  Below that is my new streamlined code, 
taking some advice to consolidate time & date to one field.  I don't 
see any conflict that i know of, maybe you all can see something i'm 
missing.

Thanks, Clay


Function GetWedgeData()

' 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
DDETerminate ChannelNumber
' 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.

If IsNumeric(MyData) Then   ' data is all numeric data
   Select Case Len(MyData)  ' how long is the numeric string?

    (HERE IS WHERE IT HANGS UP)
    
    Case 4
        Forms![SCANFORM]!ProcessID.SetFocus
        Forms![SCANFORM]!ProcessID.Text = MyData
    Case 5
        Forms![SCANFORM]!ReworkNo.SetFocus
        Forms![SCANFORM]!ReworkNo.Text = MyData
    
   End Select
Else   ' data is a text string - assume that it is initials of 
operator
        Forms![SCANFORM]!Doneby.SetFocus
        Forms![SCANFORM]!Doneby.Text = MyData
       
     
End If

End Function

__________________________________

Private Sub Doneby_AfterUpdate()
If IsNull(Me.txtStart) Then
        Forms![SCANFORM]!txtStart.SetFocus
        Forms![SCANFORM]!txtStart = Now()
 
    Else
        Forms![SCANFORM]!txtStop.SetFocus
        Forms![SCANFORM]!txtStop = Now()
    End If
_____
    
End Sub

Private Sub Doneby_BeforeUpdate()
If IsNull(Forms![SCANFORM]!txtStop) Then
    Application.Echo = False
    Doneby.Enabled = True
    Doneby.SetFocus
    DoCmd.FindRecord txtFind
    txtFind.SetFocus
    Doneby.Enabled = False

End Sub
_______

Private Sub txtStart_Enter()
DoCmd.OpenForm "Splash_subform2", acNormal, , , , acWindowNormal
Me.TimerInterval = 5000
DoCmd.Close acForm, "frmSplash2_subform"

End Sub
__________

Private Sub txtStop_Enter()
DoCmd.OpenForm "Splash_subform", acNormal, , , , acWindowNormal
Me.TimerInterval = 5000
DoCmd.Close acForm, "frmSplash_subform"
End Sub
________

Private Sub txtStop_GotFocus()
DoCmd.GoToRecord , , acNewRec
Forms![SCANFORM]!ReworkNo.SetFocus

End Sub










Please zip all files prior to uploading to Files section. 
Yahoo! Groups Links



 




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/I258zB/QnQLAA/TtwFAA/q7folB/TM
--------------------------------------------------------------------~-> 


Please zip all files prior to uploading to Files section. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AccessDevelopers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to