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. - Option Compare Database
-
Option Explicit
-
-
Const ShowSplit1 As Single = 5685, HideSplit1 As Single = 1500
-
Const ShowTop1 As Single = 4320, HideTop1 As Single = 0
-
Const FSCM As Integer = 4
-
Dim NoFscm(1 To 2) As Integer, DashFscm(1 To 3) As Integer
-
Dim intNSN As Integer, intCount As Integer
-
Dim strNSN(1 To 2) As String, strFSCM As String
-
-
Private Function ShowHide(Show As Boolean) As Boolean
-
With [Form_Master NSN List]
-
.txtNSN.Visible = Show
-
.txtFSCM.Visible = Show
-
.txtEndItem.Visible = Show
-
.txtRemarks.Visible = Show
-
.txtCost.Visible = Show
-
.chkOnOrder.Visible = Show
-
End With
-
-
If Show = True Then
-
With [Form_Master NSN List]
-
.SplitFormSize = ShowSplit1
-
-
.cmdShowHide.Top = ShowTop1
-
.cmdShowHide.Caption = "Hide Details"
-
End With
-
Else
-
With [Form_Master NSN List]
-
.SplitFormSize = HideSplit1
-
-
.cmdShowHide.Top = HideTop1
-
.cmdShowHide.Caption = "Show Details"
-
End With
-
End If
-
-
ShowHide = Not Show
-
End Function
-
-
Private Sub cmdFixNSN_Click()
-
'intNSN = Len(txtNSN.Value)
-
NoFscm(1) = 4
-
NoFscm(2) = 8
-
DashFscm(1) = 6
-
DashFscm(2) = 9
-
DashFscm(3) = 13
-
strNSN(1) = txtNSN.Value
-
intCount = [Form_Master NSN List].Count
-
-
Select Case Len(strNSN(1))
-
Case 16
-
strFSCM = Left(strNSN(1), FSCM)
-
txtFSCM.Value = strFSCM
-
strNSN(2) = Mid(strNSN(1), DashFscm(1), 2)
-
strNSN(2) = strNSN(2) & Mid(strNSN(1), DashFscm(2), 3)
-
strNSN(2) = strNSN(2) & Mid(strNSN(1), DashFscm(3), 4)
-
txtNSN.Value = strNSN(2)
-
Case 11
-
strNSN(2) = Left(strNSN(1), 2)
-
strNSN(2) = strNSN(2) & Mid(strNSN(1), NoFscm(1), 3)
-
strNSN(2) = strNSN(2) & Mid(strNSN(1), NoFscm(2), 4)
-
txtNSN.Value = strNSN(2)
-
End Select
-
-
DoCmd.GoToRecord , , acNext
-
End Sub
-
-
Private Sub cmdShowHide_Click()
-
Static blShow As Boolean, intCount As Integer
-
intCount = intCount + 1
-
If intCount = 1 Then
-
blShow = True
-
End If
-
blShow = ShowHide(blShow)
-
End Sub
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?
I found the problem
Const FSCM As Integer = 4
FSCM is the name of a field and the constant I defined
Sign in to post your reply or Sign up for a free account.
Similar topics |
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;
|
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...
|
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?
=================
|
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
|
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
| |
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
|
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
|
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;
}
|
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...
|
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...
|
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,...
| |
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...
|
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,...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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
| |