By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,084 Members | 1,956 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,084 IT Pros & Developers. It's quick & easy.

Run-Time Error '6'

P: n/a
I've been getting a runtime error when i'm running one of my module in
vba in access.

strfield4 = CLng(strfield4)
strfield4 = rstin("amt_issued")<--this is where the errors

the amt_issued is coming from another table and the data type is set

Please advise? thank you.

Nov 13 '05 #1
Share this Question
Share on Google+
5 Replies

P: n/a
is rstin a recordset? rstin.fields("amt_issued") perhaps? It's hard
to guess with too little information to go on. What's the error? What
did you declare strfield4 to be?

Billie Dee

Nov 13 '05 #2

P: n/a
rstin is a recordset and i delcared strfield4 as a long.

Nov 13 '05 #3

P: n/a
First of all the correct syntax to refer to a recordset field is

Second, just Dim strfield4 as Long.

Dim strfield4 as Long
Set rstin = db.OpenRecordset(strSQL)
strfield4 = rstin![amt_issued]

That should work fine. Access will automatically convert it from
double to long.

Nov 13 '05 #4

P: n/a
i have

Set rstin = db.OpenRecordset("tblsinkIN", dbOpenTable)

would that work too?

Nov 13 '05 #5

P: n/a
It should.

Nov 13 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.