TheTubaGeek
New member
- Local time
- Today, 18:12
- Joined
- Jun 18, 2011
- Messages
- 9
I feel the need to preface this post with the following:
:banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead:
I have a form that I created to pull the results of multiple queries in an Access database. While browsing for coding solutions, I came upon the VBA Code shown below in this forum:
As a reference, I currently have a Public Function setup as follows:
I then have a Private Sub Form_Load() that makes each text box pull the qCount for each associated query (txtTextBox = qCount("qQueryName")). Unfortunately, this shows each value as "1".
What is the best approach to have the appropriate values load, as well as make it where if I click on the associated Text Box label, a pre-generated report loads?
I appreciate the assistance!
:banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead::banghead:
I have a form that I created to pull the results of multiple queries in an Access database. While browsing for coding solutions, I came upon the VBA Code shown below in this forum:
Code:
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim rsCount As Integer
Dim queryNameOrSQL As String
queryNameOrSQL = "<Query Name or the SQL Statement goes here>"
Set db = CurrentDb
Set rs = db.OpenRecordset(queryNameOrSQL)
rsCount = rs.RecordCount
As a reference, I currently have a Public Function setup as follows:
Code:
Public Function qCount(arg As String) As Long
Dim qd As DAO.Recordset
rst.MoveLast
Set qd = CurrentDb.OpenRecordset(arg)
qCount = qd.RecordCount
End Function
I then have a Private Sub Form_Load() that makes each text box pull the qCount for each associated query (txtTextBox = qCount("qQueryName")). Unfortunately, this shows each value as "1".
What is the best approach to have the appropriate values load, as well as make it where if I click on the associated Text Box label, a pre-generated report loads?
I appreciate the assistance!