user1706975
user1706975

Reputation: 325

MS Access VBA Object Required Error

Dim maker as String
Set Maker = Forms![A]![B]

I can't seem to get this to work. Every time it runs, it gives me an "object required" error. This is contained within a greater module, but this is the only aspect of it that is giving me a problem.

Basically, I want "maker" to be equivalent to the contents of a text box named B on form A.

Any suggestions?

Upvotes: 5

Views: 12091

Answers (1)

Fionnuala
Fionnuala

Reputation: 91376

Do not use Set unless you are assigning an object:

Dim maker as String
Maker = Forms![A]![B]

For an object:

Dim maker as Form
Set Maker = Forms![A]

Upvotes: 8

Related Questions