473,466 Members | 1,430 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Attribute and IsLoaded

68 New Member
Hi, I have code that works in another database, 10 miles away, that I am trying to use in this database. The Code lets VBA know if the form is loaded.

Expand|Select|Wrap|Line Numbers
  1. Attribute VB_Name = "modIsLoaded"
  2. Option Compare Database
  3. Option Explicit
  4. Public bInReportOpenEvent As Boolean    ' Is report in the Open event?
  5. Public bInFormOpenEvent As Boolean      ' Is Form in the open event?
  6.  
  7. Function IsLoaded(ByVal strFormName As String) As Boolean
  8.  ' Returns True if the specified form is open in Form view or Datasheet view.
  9.  
  10.     Const conObjStateClosed = 0
  11.     Const conDesignView = 0
  12.  
  13.     If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <> conObjStateClosed Then
  14.         If Forms(strFormName).CurrentView <> conDesignView Then
  15.             IsLoaded = True
  16.         End If
  17.     End If
  18.  
  19. End Function
I am getting a compile error on the first line of this code.
Expand|Select|Wrap|Line Numbers
  1. Attribute VB_Name = "modIsLoaded"
I think the error is because I am missing a reference to the library that recognizes Attribute. The code does not work without that line. Do you see anything else that might be the problem? Do you know what library I need to reference or if there is a better way to resolve this?
Jun 15 '13 #1
1 1441
TheSmileyCoder
2,322 Recognized Expert Moderator Top Contributor
This line
Expand|Select|Wrap|Line Numbers
  1. Attribute VB_Name = "modIsLoaded"
simply contains the name of the module. Usually it is not visible as part of the module, but shown on the left hand side of the VBE, as a property.

My guess is that you have exported the modIsLoaded from your database, and then instead of importing it into the new database, you have opened the file, and copied the contents in.

Try to import the module instead, and see if that doesn't solve your problems.
Jun 17 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: j erickson | last post by:
with the following xsl and xml file, the display of the gif file with the <image/url> tag works. However, the gif file in the <description> tag using the name attribute "src" won't make the correct...
4
by: Lénaïc Huard | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I've some namespace problems when defining default values for attributes. My problem seems to come from the fact that the attributes are...
3
by: Mark Richards | last post by:
I have this code behind a report (same report as previous post); Sub Report_Open(Cancel As Integer) DoCmd.OpenForm "Report Date Range", , , , , acDialog, "Activity By Location" If Not...
1
by: bbdata | last post by:
strange thing happened when i split my database. i have a search form where you enter parameters, and get back filtered records displayed on another form. when you close this one, theres a code in...
1
by: arnold | last post by:
Hi, I've been knocking my head against the wall trying to create an XSL transform to perform "normalizations" of a set of XML files that have a common structure. % XML file before transform
2
by: gary.goodwin | last post by:
HI I am trying to understand Attribute usage. For example the class SerializableAttribute is a class correct? So why when it is actually u sed the "Attribute" portion of the name is dropped. The...
7
imrosie
by: imrosie | last post by:
Hello, Is there anyone who can help me figure out how to resolve this conflict when I try to re-compile? It keeps telling the sub or routine is not defined...but it is!?! I think (I'm a newbie)...
0
by: Thomas Wittek | last post by:
Hi! I'm using xsl:attribute-sets to reduce redundancy in my XSLT. An example from a transformation to XHTML (the attribute values are simply copied from input to output): <xsl:attribute-set...
5
JustJim
by: JustJim | last post by:
I'm not, though I wish I was! The un-help files tell me that I can use Isloaded to determine if an object is loaded (duh), but it doesn't tell me what loaded actually means. I'm trying to...
18
by: Gabriel Rossetti | last post by:
Hello everyone, I had read somewhere that it is preferred to use self.__class__.attribute over ClassName.attribute to access class (aka static) attributes. I had done this and it seamed to work,...
0
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...
0
marktang
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
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...
0
agi2029
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,...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.