Solved Use Textbox value in a Loop (1 Viewer)

theDBguy

I’m here to help
Staff member
Local time
Today, 15:03
Joined
Oct 29, 2018
Messages
21,474
I will have to remove objects next as I already did compact it. I will read the instructions for prepping files and uploading to this forum
Hi. With regards to the ambiguous name error, sounds like you may have two functions with the same name of fExecuteQuery. Did you name the module Module1?
 

mreniff

Member
Local time
Today, 15:03
Joined
Nov 30, 2012
Messages
45
Hi. With regards to the ambiguous name error, sounds like you may have two functions with the same name of fExecuteQuery. Did you name the module Module1?
You called it right. There were two modules with the same code. Now when I trigger Module1 fExecuteQuery....., results in a compile error. user-defined type not defined (these lines are highlighted when the error message dialog appears).
Function fExecuteQuery(strQuery As String, _
Optional intOptions As DAO.RecordsetOptionEnum = dbFailOnError, _
Optional blnReturnAuto As Boolean = False, _
Optional pdb As DAO.Database) As Long)

I got this before when the function isn't defined, but the function exists in Module1. I am looking right at it.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:03
Joined
Oct 29, 2018
Messages
21,474
You called it right. There were two modules with the same code. Now when I trigger Module1 fExecuteQuery....., results in a compile error. user-defined type not defined (these lines are highlighted when the error message dialog appears).
Function fExecuteQuery(strQuery As String, _
Optional intOptions As DAO.RecordsetOptionEnum = dbFailOnError, _
Optional blnReturnAuto As Boolean = False, _
Optional pdb As DAO.Database) As Long)

I got this before when the function isn't defined, but the function exists in Module1. I am looking right at it.
Hi. Just curious, which version of Access are you using? Also, can you post a screenshot of your References window? Thanks.
 

mreniff

Member
Local time
Today, 15:03
Joined
Nov 30, 2012
Messages
45
Hi. Just curious, which version of Access are you using? Also, can you post a screenshot of your References window? Thanks.
Access 2016. As I am working in Access 2016 MS Visual Basic for Applications soI am not sure where my references window is. Here is my workspace showing the Function fExecuteQuery.... below is the same space for the for the cmdUpdate code.
1585448670294.png

1585448764061.png
 

mreniff

Member
Local time
Today, 15:03
Joined
Nov 30, 2012
Messages
45
Did you compact it first then zip it? If still too large, remove unnecessary forms/reports/ etc - especially tables with attachment type fields if you have any and are not required for this. The forum is the preferred place to download from. Your link requires an M$ login.
 

mreniff

Member
Local time
Today, 15:03
Joined
Nov 30, 2012
Messages
45
Please send me the link with the instructions for prepping a DB for uploading. I ran across a few days ago and now I can't find it :(
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 06:03
Joined
May 7, 2009
Messages
19,245
if you are unable to Upload it at least show a snapshot of table Students structure.
 

mreniff

Member
Local time
Today, 15:03
Joined
Nov 30, 2012
Messages
45
if you are unable to Upload it at least show a snapshot of table Students structure.
Here is the database documentation for the students table
Access 2016. As I am working in Access 2016 MS Visual Basic for Applications soI am not sure where my references window is. Here is my workspace showing the Function fExecuteQuery.... below is the same space for the for the cmdUpdate code.

My references. I found them. the Microsoft dAO 3.6 Object Library is missing. There is not DAO folder.
1585523373160.png
 

Attachments

  • students table documentation.pdf
    56.4 KB · Views: 95

mreniff

Member
Local time
Today, 15:03
Joined
Nov 30, 2012
Messages
45
I want to thank each coder that has been assisting me. This underlying thread is not solved but I marking this thread solved. I will be opening new thread with details of the current direction of this issue.

Again, thank you
 

Micron

AWF VIP
Local time
Today, 18:03
Joined
Oct 20, 2018
Messages
3,478
DAO is part of the Database Engine Object Library now. If you're using 2016 you don't need a DAO reference. In fact, you are not allowed to set one.
 

Users who are viewing this thread

Top Bottom