473,698 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Member already exists in an object module from which this object module derives

3 New Member
I ceated a automatic split form from a table called "Master NSN List." I then added 2 buttons "cmdShowHid e" which toggles between showing and hiding the form section giving more room for the datasheet and "cmdFixNSN" which takes a portion of the NSN and puts it in another field then removes all of the dashes.

The form loads fine until i add code to either of the buttons or the form_load event then i get the message "Member already exists in an object module from which this object module derives"

I have tried to change the name of the form and the buttons, deleting the form and recreating it, building a query and basing the form off of it but nothing works.

Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Option Explicit
  3.  
  4. Const ShowSplit1 As Single = 5685, HideSplit1 As Single = 1500
  5. Const ShowTop1 As Single = 4320, HideTop1 As Single = 0
  6. Const FSCM As Integer = 4
  7. Dim NoFscm(1 To 2) As Integer, DashFscm(1 To 3) As Integer
  8. Dim intNSN As Integer, intCount As Integer
  9. Dim strNSN(1 To 2) As String, strFSCM As String
  10.  
  11. Private Function ShowHide(Show As Boolean) As Boolean
  12.     With [Form_Master NSN List]
  13.         .txtNSN.Visible = Show
  14.         .txtFSCM.Visible = Show
  15.         .txtEndItem.Visible = Show
  16.         .txtRemarks.Visible = Show
  17.         .txtCost.Visible = Show
  18.         .chkOnOrder.Visible = Show
  19.     End With
  20.  
  21.     If Show = True Then
  22.         With [Form_Master NSN List]
  23.             .SplitFormSize = ShowSplit1
  24.  
  25.             .cmdShowHide.Top = ShowTop1
  26.             .cmdShowHide.Caption = "Hide Details"
  27.         End With
  28.     Else
  29.         With [Form_Master NSN List]
  30.             .SplitFormSize = HideSplit1
  31.  
  32.             .cmdShowHide.Top = HideTop1
  33.             .cmdShowHide.Caption = "Show Details"
  34.         End With
  35.     End If
  36.  
  37.     ShowHide = Not Show
  38. End Function
  39.  
  40. Private Sub cmdFixNSN_Click()
  41.     'intNSN = Len(txtNSN.Value)
  42.     NoFscm(1) = 4
  43.     NoFscm(2) = 8
  44.     DashFscm(1) = 6
  45.     DashFscm(2) = 9
  46.     DashFscm(3) = 13
  47.     strNSN(1) = txtNSN.Value
  48.     intCount = [Form_Master NSN List].Count
  49.  
  50.     Select Case Len(strNSN(1))
  51.     Case 16
  52.         strFSCM = Left(strNSN(1), FSCM)
  53.         txtFSCM.Value = strFSCM
  54.         strNSN(2) = Mid(strNSN(1), DashFscm(1), 2)
  55.         strNSN(2) = strNSN(2) & Mid(strNSN(1), DashFscm(2), 3)
  56.         strNSN(2) = strNSN(2) & Mid(strNSN(1), DashFscm(3), 4)
  57.         txtNSN.Value = strNSN(2)
  58.     Case 11
  59.         strNSN(2) = Left(strNSN(1), 2)
  60.         strNSN(2) = strNSN(2) & Mid(strNSN(1), NoFscm(1), 3)
  61.         strNSN(2) = strNSN(2) & Mid(strNSN(1), NoFscm(2), 4)
  62.         txtNSN.Value = strNSN(2)
  63.     End Select
  64.  
  65.     DoCmd.GoToRecord , , acNext
  66. End Sub
  67.  
  68. Private Sub cmdShowHide_Click()
  69. Static blShow As Boolean, intCount As Integer
  70.     intCount = intCount + 1
  71.     If intCount = 1 Then
  72.         blShow = True
  73.     End If
  74.     blShow = ShowHide(blShow)
  75. End Sub
Nov 21 '09 #1
2 7290
ADezii
8,834 Recognized Expert Expert
@jesus4gaveme03
It will be pretty hard to resolve this problem simply by looking at the code itself. Can you Upload a Copy of the Database? BTW, does your Project Name conflict with anything?
Nov 21 '09 #2
jesus4gaveme03
3 New Member
I found the problem

Const FSCM As Integer = 4

FSCM is the name of a field and the constant I defined
Nov 21 '09 #3

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

Similar topics

15
8054
by: Wolfram Humann | last post by:
Hi, please don't be too harsh if I made stupid errors creating this simple example from my more complex case. Suppose I have a class like this: class BOOK { const string title;
11
4603
by: Roger Leigh | last post by:
The C++ book I have to hand (Liberty and Horvath, Teach yourself C++ for Linux in 21 Days--I know there are better) states that "static member functions cannot access any non-static member variables". However, this doesn't seem entirely correct. It also doesn't mention whether static member functions can access protected and private member data and methods (and I couldn't spot this in the FAQ). I have a class row<Row> which derives from...
8
4582
by: Scott J. McCaughrin | last post by:
The following program compiles fine but elicits this message from the linker: "undefined reference to VarArray::funct" and thus fails. It seems to behave as if the static data-member: VarArray::funct were an extern, but it is declared in the same file (q.v.). What is the remedy for this? =================
12
1516
by: akiriwas | last post by:
The subject basically says what I am having trouble with. For an example lets say I have a class A which has a function f. I then also have a class B which inherits from A and has a function g. class A { public: void f(int,float); }; class B : public A
7
12453
by: ank | last post by:
Hi, I was curious about how to define static data member of template class. Should I put the definition in a separate source file or in the same header file as its template class? And when this data will be initialized if it is used across many translation unit, assume that it has constructor and needs dynamic initialization? I have blindly searched for the answer but I still not thoroughly
5
2618
by: Peter Olcott | last post by:
I created an object that requires access to another objects data, yet have found no good way to pass this data as a parameter because the member function that requires this data must be a binary predicate for std::sort. The only way that I got it to work so far is to make the other object global. Are there any better ways than this? Thanks, Peter Olcott
2
1495
by: hardieca | last post by:
Good morning, I am creating a CMS which I would like to support multiple DBs for its back-end. I have taken the approach of using DBProviderFactories to keep my code flexible enough so that I can switch backends simply by changing the provider and connection strings stored in my App.config file. However, there are a few methods I would like to add to the Command object to wrap up a few inconsistencies of how DBs implement certain
16
3622
by: Fir5tSight | last post by:
Hi All, I have a small C#.NET program that is as follows: using System; class A { protected int x = 123; }
52
20882
by: Ben Voigt [C++ MVP] | last post by:
I get C:\Programming\LTM\devtools\UselessJunkForDissassembly\Class1.cs(360,27): error CS0535: 'UselessJunkForDissassembly.InvocableInternals' does not implement interface member 'UselessJunkForDissassembly.IInvocableInternals.OperationValidate(string)' C:\Programming\LTM\devtools\UselessJunkForDissassembly\Class1.cs(360,27): error CS0535: 'UselessJunkForDissassembly.InvocableInternals' does not implement interface member...
0
8671
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8598
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9016
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8887
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7709
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6515
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4360
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4613
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3037
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 we have to send another system

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.