passing a value in access vba 2013

I am having trouble passing a value.

The main routine works with only one variable passed to the submitVIN routine but when trying to pass VRR_VehicleID it highlights the line red.

Public Sub Main()
Dim dbs As DAO.Database
Dim rstVins As DAO.Recordset
Set dbs = CurrentDb
Set rstVins = dbs.OpenRecordset("QryBaseDataAllModels")
Dim x As Long
Dim counter As Long
counter = 0
varReturn = SysCmd(acSysCmdSetStatus, "Text to write on the Status Bar!")

With rstVins
x = .RecordCount
Debug.Print "total records: " & x
'method one
    Do Until .EOF
 varReturn = SysCmd(acSysCmdSetStatus, counter)

Debug.Print .Fields("Vintouse").Value

'************** red here ***************************
SubmitVIN(.Fields("Vintouse").Value, .Fields("VRR_VehicleID").Value)

  varReturn = SysCmd(acSysCmdSetStatus, " ")
     counter = counter + 1
    VehID = VehID + 1
    x = x - 1
    Debug.Print x
End With
MsgBox ("end")
End Sub

Open in new window

submitvin header : Public Sub SubmitVIN(strVIN As String, VehIn As Long)
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:

SubmitVIN(.Fields("Vintouse").Value, .Fields("VRR_VehicleID").Value)


call SubmitVIN(.Fields("Vintouse").Value, .Fields("VRR_VehicleID").Value)


AND what's the error message you get? can you post the scripts for sub SubmitVIN ?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial

pls try

SubmitVIN .Fields("Vintouse").Value, .Fields("VRR_VehicleID").Value
SubmitVIN .Fields("Vintouse").Value, cLng(.Fields("VRR_VehicleID").Value)

Open in new window

PeterBaileyUkAuthor Commented:
worked a treat thank you
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.