'Search all reports for a text box named something
Dim cMsg As String, db As Database, rs As Recordset, rpt As Report, ctl as
Control
Set db = CurrentDb()
cMsg = "BuildingID"
Set rs = db.OpenRecordset("SELECT [NAME] AS REPORTOBJ FROM MSYSOBJECTS
WHERE [TYPE] = -32764;")
Do Until rs.EOF
DoCmd.openReport rs("REPORTOBJ"), acViewDesign, , , acHidden
Set rpt = Reports(rs("REPORTOBJ"))
For Each ctl In rpt.Controls
If ctl.ControlType = acTextBox Then
If ctl.Name = cMsg Then
Debug.Print "Report: " & rpt.Name & " contains " & cMsg
Exit For
End If
End If
Next ctl
Set rpt = Nothing
DoCmd.Close acReport, rs("REPORTOBJ"), acSaveNo
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
MsgBox "Finished checking reports for " & cMsg 4 1841
Are you just sharing with us, or do you have a question? Generally, people
don't just post VBA code without some explanation.
Larry Linson
"DFS" <nospam@dfs_.comwrote in message
news:yS*****************@bignews3.bellsouth.net...
'Search all reports for a text box named something
Dim cMsg As String, db As Database, rs As Recordset, rpt As Report, ctl as
Control
Set db = CurrentDb()
cMsg = "BuildingID"
Set rs = db.OpenRecordset("SELECT [NAME] AS REPORTOBJ FROM MSYSOBJECTS
WHERE [TYPE] = -32764;")
Do Until rs.EOF
DoCmd.openReport rs("REPORTOBJ"), acViewDesign, , , acHidden
Set rpt = Reports(rs("REPORTOBJ"))
For Each ctl In rpt.Controls
If ctl.ControlType = acTextBox Then
If ctl.Name = cMsg Then
Debug.Print "Report: " & rpt.Name & " contains " & cMsg
Exit For
End If
End If
Next ctl
Set rpt = Nothing
DoCmd.Close acReport, rs("REPORTOBJ"), acSaveNo
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
MsgBox "Finished checking reports for " & cMsg
Just sharing a handy snippet.
Larry Linson wrote:
Are you just sharing with us, or do you have a question? Generally,
people don't just post VBA code without some explanation.
Larry Linson
"DFS" <nospam@dfs_.comwrote in message
news:yS*****************@bignews3.bellsouth.net...
>'Search all reports for a text box named something
Dim cMsg As String, db As Database, rs As Recordset, rpt As Report, ctl as Control Set db = CurrentDb() cMsg = "BuildingID"
Set rs = db.OpenRecordset("SELECT [NAME] AS REPORTOBJ FROM MSYSOBJECTS WHERE [TYPE] = -32764;") Do Until rs.EOF DoCmd.openReport rs("REPORTOBJ"), acViewDesign, , , acHidden Set rpt = Reports(rs("REPORTOBJ")) For Each ctl In rpt.Controls If ctl.ControlType = acTextBox Then If ctl.Name = cMsg Then Debug.Print "Report: " & rpt.Name & " contains " & cMsg Exit For End If End If Next ctl Set rpt = Nothing DoCmd.Close acReport, rs("REPORTOBJ"), acSaveNo rs.MoveNext Loop
rs.Close Set rs = Nothing MsgBox "Finished checking reports for " & cMsg
Thanks for the effort, it is appreciated.
Perhaps a more relevant title that would be more easily found by a google
groups search?
"DFS" <nospam@dfs_.comwrote in message news:IIHfh.71$Iz.38@bigfe9...
Just sharing a handy snippet.
Larry Linson wrote:
>Are you just sharing with us, or do you have a question? Generally, people don't just post VBA code without some explanation.
Larry Linson
"DFS" <nospam@dfs_.comwrote in message news:yS*****************@bignews3.bellsouth.net.. .
>>'Search all reports for a text box named something
Dim cMsg As String, db As Database, rs As Recordset, rpt As Report, ctl as Control Set db = CurrentDb() cMsg = "BuildingID"
Set rs = db.OpenRecordset("SELECT [NAME] AS REPORTOBJ FROM MSYSOBJECTS WHERE [TYPE] = -32764;") Do Until rs.EOF DoCmd.openReport rs("REPORTOBJ"), acViewDesign, , , acHidden Set rpt = Reports(rs("REPORTOBJ")) For Each ctl In rpt.Controls If ctl.ControlType = acTextBox Then If ctl.Name = cMsg Then Debug.Print "Report: " & rpt.Name & " contains " & cMsg Exit For End If End If Next ctl Set rpt = Nothing DoCmd.Close acReport, rs("REPORTOBJ"), acSaveNo rs.MoveNext Loop
rs.Close Set rs = Nothing MsgBox "Finished checking reports for " & cMsg
Here ya go...
David F Cox wrote:
Thanks for the effort, it is appreciated.
Perhaps a more relevant title that would be more easily found by a
google groups search?
"DFS" <nospam@dfs_.comwrote in message news:IIHfh.71$Iz.38@bigfe9...
>Just sharing a handy snippet.
Larry Linson wrote:
>>Are you just sharing with us, or do you have a question? Generally, people don't just post VBA code without some explanation.
Larry Linson
"DFS" <nospam@dfs_.comwrote in message news:yS*****************@bignews3.bellsouth.net. .. 'Search all reports for a text box named something
Dim cMsg As String, db As Database, rs As Recordset, rpt As Report, ctl as Control Set db = CurrentDb() cMsg = "BuildingID"
Set rs = db.OpenRecordset("SELECT [NAME] AS REPORTOBJ FROM MSYSOBJECTS WHERE [TYPE] = -32764;") Do Until rs.EOF DoCmd.openReport rs("REPORTOBJ"), acViewDesign, , , acHidden Set rpt = Reports(rs("REPORTOBJ")) For Each ctl In rpt.Controls If ctl.ControlType = acTextBox Then If ctl.Name = cMsg Then Debug.Print "Report: " & rpt.Name & " contains " & cMsg Exit For End If End If Next ctl Set rpt = Nothing DoCmd.Close acReport, rs("REPORTOBJ"), acSaveNo rs.MoveNext Loop
rs.Close Set rs = Nothing MsgBox "Finished checking reports for " & cMsg
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: mike420 |
last post by:
In the context of LATEX, some Pythonista asked what the big
successes of Lisp were. I think there were at least three *big*
successes.
a. orbitz.com web site uses Lisp for algorithms, etc.
b....
|
by: Pmb |
last post by:
I'm confused as to what the compiler error message I'm getting is refering
to. Can someone take a gander and let me know what I did wrong? The program
is below. When I compile it I get the...
|
by: Gerry Abbott |
last post by:
Hi All,
If completed a script which parses a string into fragments (fields), then
assigns these substrings into an array.
I wish to turn this into a function to which i can pass the string....
|
by: Ivo |
last post by:
Hello all, while I am no astronomer or mathematician, I was wondering if
anyone could shed some light on the following question.
The phases of the moon have intrigued mankind since the dawn of...
|
by: Bell, Kevin |
last post by:
Sorry if this is an off topic shot in the dark, but...
Does anyone know a contact for anyone that works for Google Earth? I
wanted to shoot 'em an email about a possible enhancement, but they're...
| |
by: John Morgan |
last post by:
I have been looking at the Microsoft Virtual Earth SDK. As far as I
can see I have to incorporate it in a web page using a control based
on Javascript through web services
It being a Microsoft...
|
by: John Walsh |
last post by:
Hi,
I'd like to write a python script to control Google Earth,
and I've read that Google Earth provides a COM api, and that
Python has a COM module 'pythoncom'.
Anyone know where to get...
|
by: =?Utf-8?B?Tmlrb2xheSBQb2Rrb2x6aW4=?= |
last post by:
Good noon, community! Please help me solve my problem. I need use
Microsoft(r) Virtual Earth in the my application. How can i do it?
Thanks in advance!
|
by: service2online |
last post by:
See your home on your computer through google earth
SURPRIZE !
Enjoy amazing time see your earth completely
Even your house
Now see on your computer
By controlling your self...
|
by: JWcode |
last post by:
Hello,
I am trying to do paging and Virtual Earth on the same page. I want to have the ten results on each page mapped with Virtual Earth. I can't figure out how to go through the results a...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |