Hi,
is there any VBA code I can try to get all tables, queries and forms of my database selected and displayed in a list box of a form? And also the list box must be always held the current vlaues. Meaning if I enter a new table or form, the list box needs to show it.
Any help is much appreciated. :)
Thanks
5 4764
Create a lookup table called ObjectType as follows:
TypeID TypeDesc
====== ========
1 Table
5 Query
-32768 Form
-32764 Report
You could then use a query on the Msysobjects table as follows:
SELECT DLookUp("[TypeDesc]","ObjectType","[TypeID]=" & [MsysObjects].[Type]) AS ObjType, MsysObjects.Name
FROM MsysObjects
WHERE (((DLookUp("[TypeDesc]","ObjectType","[TypeID]=" & [MsysObjects].[Type])) Is Not Null) AND ((MsysObjects.Name) Not Like '~*' And (MsysObjects.Name) Not Like 'MSys*'))
ORDER BY DLookUp("[TypeDesc]","ObjectType","[TypeID]=" & [MsysObjects].[Type]), MsysObjects.Name;
Hi,
is there any VBA code I can try to get all tables, queries and forms of my database selected and displayed in a list box of a form? And also the list box must be always held the current vlaues. Meaning if I enter a new table or form, the list box needs to show it.
Any help is much appreciated. :)
Thanks
I did like you said. But it is given me an error message saying "data type mismatch in criteria expression". Also I can't exit the error message any more, need to end task via task manager.
Are you sure it works?
Create a lookup table called ObjectType as follows:
TypeID TypeDesc
====== ========
1 Table
5 Query
-32768 Form
-32764 Report
You could then use a query on the Msysobjects table as follows:
SELECT DLookUp("[TypeDesc]","ObjectType","[TypeID]=" & [MsysObjects].[Type]) AS ObjType, MsysObjects.Name
FROM MsysObjects
WHERE (((DLookUp("[TypeDesc]","ObjectType","[TypeID]=" & [MsysObjects].[Type])) Is Not Null) AND ((MsysObjects.Name) Not Like '~*' And (MsysObjects.Name) Not Like 'MSys*'))
ORDER BY DLookUp("[TypeDesc]","ObjectType","[TypeID]=" & [MsysObjects].[Type]), MsysObjects.Name;
In the lookup table ObjectType did you declare the TypeID as a Number (Long Integer).
I tested the query and it did work.
I did like you said. But it is given me an error message saying "data type mismatch in criteria expression". Also I can't exit the error message any more, need to end task via task manager.
Are you sure it works?
:o
No I did not! Sorry.
It's working now. I needed to add Tpe 6 as well because there were linked tables.
Thanks very much for you help! :)
In the lookup table ObjectType did you declare the TypeID as a Number (Long Integer).
I tested the query and it did work.
This worked in the query but I was not able to view the field "Names" in the list box of the form. The only field that was displayed was ObjType.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Andreas Lauffer |
last post by:
I changed from Access97 to AccessXP and I have immense performance
problems.
Details:
- Access XP MDB with Jet 4.0 ( no ADP-Project )
- Linked Tables to SQL-Server 2000 over ODBC
I used...
|
by: Jonathan LaRosa |
last post by:
Hi all -
I'm wondering if anyone has (or knows of) a tool that will allow me to
search through VB code, tables, queries, reports, forms, and other
objects, for references to all other types of...
|
by: Sean Byrne |
last post by:
We have a Microsoft Access 2000 database consisting of 20 tables
covering 20 different events. In each table, there are 3 Team
members, a date of the event and several unique fields for the event,...
|
by: Julia |
last post by:
Hello there.
I have a question somewhat related to this topic, and I don't know
where else to go. I hope somebody can help. I've created a database
in access, that I'd like to share with less...
|
by: Kevin Forbes |
last post by:
So, I've found how to list all the tables in an Access database (as
seen below) and running MS Access queries is easy (similar to
executing a stored procedure), but how do I list the names of all...
|
by: Robert |
last post by:
How do you get an accurate count of the number of records returned from
a query when using linked tables.
I have an access 2003 database as a front end to another access 2003
database that...
|
by: Jim Devenish |
last post by:
I have a split front end/back end system. However I create a number of
local tables to carry out certain operations. There is a tendency for
the front end to bloat so I have set 'compact on...
|
by: shriil |
last post by:
Hi
I have this database that calculates and stores the incentive amount
earned by employees of a particular department. Each record is
entered
by entering the Date, Shift (morn, eve, or night)...
|
by: dstorms |
last post by:
Hi there,
I'm developing a database for my company, and for the most part I've been successful, with some complex sub-routines already working fine. But this one has me stumped!
Some background...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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: 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...
| | |