473,471 Members | 1,696 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Novice needs help with Yes/No Msgbox in Access 07

1 New Member
My form is used for entering records in Access 2007.

When a user clicks a button to submit one, I want a pop-up box to load up
saying "Would you like to enter another record?" with Yes or No options
listed below. If yes, a new blank record loads up, if no, the form closes. My form and table are both called Hospitals.

How can I do this? (I am a bit of an Access novice so if you could be basic
in your answer - i.e. where to place code, etc. that would be great).

Thanks!
Jul 18 '08 #1
1 1623
missinglinq
3,532 Recognized Expert Specialist
If this is a bound form, i.e. based on a table or query, the following will do the job nicely.

Expand|Select|Wrap|Line Numbers
  1. Private Sub YourSaveButton_Click()
  2. If Reps = MsgBox("Would you like to enter another record?", vbYesNo) = vbYes Then
  3.   DoCmd.GoToRecord , , acNewRec
  4. Else
  5.  If Me.Dirty Then Me.Dirty = False
  6.  DoCmd.Close
  7. End If
  8. End Sub
If the form is bound, you don't need to do anything to save the record. Records on bound forms are automatically saved, in Access, when the user changes to another record or when the form is closed.

Welcome to Bytes!

Linq ;0)>
Jul 18 '08 #2

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

Similar topics

3
by: Donna Sabol | last post by:
I know a little about VBA, but everything I know I've learned on my own through trial and error (and cut & paste). Now I'm actually taking a class, but it's online twice a week. I'm running...
6
by: ronwer | last post by:
Hello, The title doesn't completely cover the question I have, but it's a bit more complicated problem we have. We are using a database, based on Acces, but developed by a third party...
8
by: Zellan | last post by:
Hi All, Have added a Strconv function to the AfterUpdate event of a field to give me first letter capitalization (vbProperCase). I have added a msgbox that will allow me to over-ride where...
11
by: Wilsoch | last post by:
Long story short: My Access developer is letting me down. He doesn't really know VB and he can't figure out how to do what I need. Situation: Access database that will be used locally on...
3
by: kathyk | last post by:
Hi All, I am using Access 2003 on machines with windows 2000 and XP. The problem I'm having started only after we got a new image for our PC's. This database app has been around for awhile and...
8
by: darnnews | last post by:
I have a form. When a person selects a publication from a listbox, this snippet of code is supposed to look up authors that correspond to that publication and populate the Author List Box, but...
1
by: Vincent | last post by:
I do not have a strong grasp of the winsock library, but have started fiddling around with it a bit. My first impression is that using winsock in Access is a bit unwieldy. I was making a...
9
by: Kelii | last post by:
I've been trying to get this piece to work for a few hours, but have given up. I hope someone out there can help, I think the issue is relatively straightforward, but being a novice, I'm stumped....
2
by: DayzedandConfused | last post by:
Here I go.. I haven't worked with Access for almost a decade and due to recent abrupt job change need to write a simple data base. I am creating a data base to reference a larger one. It needs...
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,...
0
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...
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.