473,322 Members | 1,417 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

How to limit a form to only one record.

1
Hi
I have a form let's say for a real estate agent. He fills the form, with his name, address, etc., etc. He can also attach a picture of himself, a property, whatever.

My Problem
When all the information is filled in, I DO NOT want the option of moving to the NEXT record.
This is for a "one time" record.
I have Googled to no avail of finding a solution. And given that databases are for adding NEW entries, I am beginning to wonder if what I want is actually possible. I see solutions for a myriad of problems, but I haven't had any luck finding a solution for this.
Thanks
Apr 5 '10 #1
1 15017
topher23
234 Expert 100+
It looks like what you want is for the user to add a single new record, but no more. Here's the option I use.

Suppose you have a form called frmInfo with a field called txtName.
In the form's On Open event, put the following code:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  2.     Me.DataEntry = True
  3.     Me.txtName = ""
  4.     Me.AllowAdditions = False
  5. End Sub
  6.  
This sets the form to data entry only (no editing old records), puts an empty string into a field in order to populate the record, then makes it so you can't add any more records by setting AllowAdditions to False. The user can then put any info they want into the current record, but can't do anything else.
Apr 5 '10 #2

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

Similar topics

1
by: Konstantin | last post by:
Can someone help me figure out a way to open a form only once in an MDI app. I have an MDI app that contains several forms. I use each form depending on the type of document that the user needs...
5
by: Sami | last post by:
Please bear with me, and if you answer this question, please do it step by step. I am new at Access, not at all sophisticated. I am using Office XP. This will need to be read in Access for...
2
by: vulcaned | last post by:
Hi All, I'm stuck, so....... In Access97 I have a form which has a subform(setup as a continous form), after a user selects several things on the form the subform gets requeryed and displays the...
22
by: Br | last post by:
First issue: When using ADPs you no longer have the ability to issue a me.refresh to save the current record on a form (the me.refresh does a requery in an ADP). We usually do this before...
13
by: ricky.agrawal | last post by:
I'm really not sure how to go about this in Access. What I've created is a table for each location. Those tables are identical in format but different in information. The tables are named after...
27
by: Kim Webb | last post by:
I have a field on a form for project number. I basically want it to be the next available number (ie 06010 then 06011 etc). In the form I create a text box and under control source I put: =!=...
7
by: chrismaliszewski | last post by:
Hi. I created code which makes dynamically form with bounded controls for all columns. I show it to you below. My problem is, how I have to change this code to create form which record source...
17
by: msmjsuarez | last post by:
Hello, I need help... How to automatically insert data to mysql database without submit button using php? Is there a way on this? thanks a lot.
2
by: msmjsuarez | last post by:
Hello. Is it possible to insert data to two tables at one time using one form only? I'm using php and mysql. Thanks advance.
1
by: HSXWillH | last post by:
I am trying to import Excel files that contains names and stock id's. The format is something akin to this: Stock Description -- Players 1991 Topps #145 -- Frank Thomas/Sammy Sosa/Cal Ripken ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.