Alphanumeric Part #'s and Type Mismatch

J

jhunter

=====
ISSUE
=====
My supplier changed their part#'s from numeric to alphanumeric (I'm now
getting a "type mismatch" on intID1 and intID2 which are setup as data
type LONG).

How can I do this with the new alphanumeric part#'s?

NOTE: The part# is the only UNIQUE field for the table.


==========
BACKGROUND
==========
O/S = Win2k Pro
Patches Installed

Software = Access 2000
Patches Installed



======
LEGEND
======
++++ = Where it fails



====
CODE
====
Public Function fWEBpr______EXPORTtoHTML()
' W R I T E S P R O D U C T S T O H T M L
' Written by Jeff
' Edited 4/1/2003
Debug.Print "=F U N C T I O N (fWEBpr______EXPORTtoHTML)"
'Variables
Dim db As Database
Dim rs As Recordset
Dim intID1 As Long
Dim intID2 As Long
Dim strID As String
Dim strDetails As String
Dim FileNum As Long
Dim strDQ As String 'Double Quote
strDQ = """"

FileNum = FreeFile
Set db = CurrentDb()
Set rs = db.OpenRecordset("qryWEBpr______HTML")

'Do While Loop
Do While Not rs.EOF
FileNum = FreeFile
intID1 = rs!ItemID '++++ THIS IS WHERE IT FAILS ++++
strID = rs!ItemID
intID2 = intID1
'Start writing to file
Open "\\a\store\pr-" & strID & ".html" For Output As FileNum

'Beginning of HTML
Print #FileNum, "<!DOCTYPE...>

'The rest of the HTML is here
Print #FileNum, "</BODY></HTML>"



Close FileNum
rs.MoveNext
Loop



End Function




=========
Thanks!!!
THE END
=========
 
V

Van T. Dinh

Change intID1 and intID2 to strID1 & strID2 and declare them as String
instead of Long.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top