Hi,
I have a command button which has a macro running in it.
The macro on the click event, runs to ensure that certain values in a
form are valid, (e.g. the textboxes are not null)
and after the macro runs, an update query would run...
the problem is that how can i ensure that the update query would only
run after the macro find that the fields entered are valid..
i was thinkin i first place a command button to run the query, and
after the query has been run and the fields entered are valid, then
another command button appears to allow user to click to run the query.
i know the command button can be made visible after a certain condition
has been met..but all the conditions are found in a macro..so can i put
in VBA: If macro.NameofMac ro = True, then run the query?
Thanks in advance! 2 5612
"Darren" <Ye********@gma il.com> wrote in message
news:11******** **************@ g49g2000cwa.goo glegroups.com.. . Hi,
I have a command button which has a macro running in it.
The macro on the click event, runs to ensure that certain values in a form are valid, (e.g. the textboxes are not null)
and after the macro runs, an update query would run...
the problem is that how can i ensure that the update query would only run after the macro find that the fields entered are valid..
i was thinkin i first place a command button to run the query, and after the query has been run and the fields entered are valid, then another command button appears to allow user to click to run the query.
i know the command button can be made visible after a certain condition has been met..but all the conditions are found in a macro..so can i put in VBA: If macro.NameofMac ro = True, then run the query?
Thanks in advance!
It looks like you are making things very difficult for yourself. Normally
forms are bound to a datasource and that does all the work for you. You set
the required property of fields to true and then trying to save a record
would result in an error which you could catch and deal with.
Creating an unbound form with a button to add or update records is possible,
but really this is above what macros are good for - you should be writing
proper vba code with error-handling to make sure your code works.
Is there something special about your situation here, perhaps like you want
to do a batch update or something? Perhaps post a quick explanation and
indicate whether you would be OK with vba code as opposed to the pretty
limited Access macros.
i see...coz what i need to do is to update a user password...
therefore, i need to validate whether the user provided the correct
password, and also whether the new and confirmed password matches..
Then can i run the update query to change the password...
but in this case, the query runs irregardless whether the macro does
the validation or not..
And even if the input were valid/ correct, then i would run another
macro to go to the default logon screen..
Do note that it's a custom logon form, not Access level security...i'm
not using it because there's no need for a small company with few
users...
Thanxs! Ya see, i'm very new with access.. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Mickel Grönroos |
last post by:
Hi,
I have a Tkinter.Canvas of variable width. Is there a standard way of
asking the canvas which parts of it that is visible? I.e. on the
horizontal scale, I would like to know at what fraction from the left the
left visibility border is and from what fraction to the right the right
visibility border is.
Consider this ascii picture as an example
|
by: peter_bradley |
last post by:
Hi all,
Not sure if this is possible, but can I change the controls of a
command button on a per record bases in a subform. In my case, I would
like to make a command button visible only if certain fields in a table
are a certain value. Here is the subroutine I've written so far:
Public Sub IsButtonVisible()
'For Access, define some object variables and make connections.
|
by: PCB |
last post by:
Hi all,
Not sure if this is possible, but can I change the controls of a
command button on a per record bases in a subform. In my case, I would
like to make a command button visible only if certain fields in a table
are a certain value. The buttons are adjacent to each record (i.e. - if
there are 5 records, there would be 5 buttons; 10 records, 10 buttons;
etc.) Here is the subroutine I've written so far:
Public Sub IsButtonVisible()
|
by: Susan Bricker |
last post by:
Greetings. I have three forms that are open at the same time. They are
related and cascading. The first form (frmEventAdd) is the anchor. Each
event can have many Trials. The second form is frmTrialInfo. Each Trial
can have three Classes. The third form is frmClassInfo. These forms are
used for update and adding new records.
The user displays an event for update (frmEventAdd). Then clicks on a
button to display the Trials for that event...
|
by: Miguel Dias Moura |
last post by:
Hello,
i have 5 panels in an ASP.net / VB page.
The panel 1 is visible the other 4 are NOT visible.
I also have 5 images: image 1, image 2, ..., image5.
When i click one of the images, image N, the panel N becomes visible and
all the other invisible.
| |
by: feeman |
last post by:
I have a form in access 2000 with a combo box containing names, this
is linked to a sub form by the name index. on the sub form is a
button that when pressed automatically enters the date into the date
field. Now my problem is that when someone comes in and finds their
name and presses the sign in button it is no longer visible so they
can not sign in more than once that day.
My trouble is that i can nor remember how to use the button...
|
by: Miki |
last post by:
Hello,
I have a simple Tkinter window with and buttons at the
bottom.
When I resize the window to be shorter, the first thing to disappear
are the buttons, however I want these button to be visible at all
times.
Is there a way to make sure that these buttons are always visible?
|
by: Tetelestai |
last post by:
I have a command button on a form that should be visible or not visible depending on a value in the current record and the current users user level. The code below is working as in the immediate window i get true and false when appropriate. However the command button will stay in its current state for several records. At times when I switch to the immediate window and back the button will do what it is supposed to do (ie be visible or hide). I...
|
by: Studiotyphoon |
last post by:
Hi,
I have report which I need to print 3 times, but would like to have
the following headings
Customer Copy - Print 1
Accounts Copy - Print 2
File Copy -Print 3
I created a macro to print the report three times, but do not know how
|
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: 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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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: 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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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: 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: 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
| |