473,395 Members | 1,537 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,395 software developers and data experts.

How to delete a record using an unbound form

Good Day everyone! Here's what I'm trying to do in a nutshell. I have a table that I want to allow people to manipulate via forms. I'm using unbound forms because I don't want users to be able to add/delete/edit fields without validations. For my delete form, I want to use a combo box that loads up all of the items in column 1 (serial#) during the form load event. The user will pick an item and use a command button called "find record". I want the click event of that button to populate the rest of the fields in the related record to text boxes. Then the user will use a "delete record" command button to delete the record. I've declared the recordset, and I'm thinking I need to use a dynamic array, but I'm finding that this might be more advanced than I thought...does anyone have any suggestions?
Jun 25 '10 #1
13 4449
missinglinq
3,532 Expert 2GB
"I'm using unbound forms because I don't want users to be able to add/delete/edit fields without validations."
I wish I knew what idiot started this completely false rumor about needing unbound forms in order to do validation!

A big part of the reason to use Access for database development is the speed with which it can be created, using bound forms. Several developers I know, experienced in Visual Basic database development and Access development, estimate that development using unbound forms by experienced developers takes twice as long as it does when using Access and bound forms.

The belief that unbound forms are necessary in order to do data validation (the reason usually given) is simply not true! Validation on bound forms is easily done thru use of the Form_BeforeUpdate event.

If you insist on using unbound forms, you'd be far better off using a straight VB or C++ front end with a SQL Server or Oracle back end.
  1. You can create an EXE file which gives total protection to your code/design
  2. You can distribute the db to PCs without a copy of Access being on board
  3. Your data security if far, far better than anything you can do in Access

Linq ;0)>
Jun 25 '10 #2
Jerry Maiapu
259 100+
I think the trick is this:

1.Keep the form bound to the table by dragging the table into the form and delete rest and leave the desired columns. This creates a sub form.
To keep users away from editing/modifying the displayed records,set Enable: Yes and Locked: Yes
and also set the Navigation Buttons:NO on the sunform

From now I do not think the users will be exposed to any buttons to edit/modify the records.

To do the search, simple create combo using wizard and follow prompts or you can create a form based search.

Just an idea there..I am quite rushing

Sorry its late now..I need to go home..post comment and I'll properly see into this 2morow..
Jun 28 '10 #3
NeoPa
32,556 Expert Mod 16PB
Like Linq, I'm confused as to why so many members feel that coding around Access, rather than using Access to do what it does best, as in unbound and bound forms respectively, is somehow a better approach. If you use unbound forms then much of what is available to help you validate the operator choices is missing. I have to say my advice would be to use bound forms, and if you feel there are holes that don't allow you to do as you think is right, then perhaps raise those as questions. I expect there are people here who can point you in the right direction from there.

Otherwise, as Linq says also, you may as well be using a proper programming language. There's little benefit to using VBA unless you take advantage of the Office functionality.
Jul 5 '10 #4
Jerry Maiapu
259 100+
Most Newbie do not seem to reply to responses to their questions.
Why is that?. If someone is serous about getting their problem solved then I think they should follow posts and reply accordingly..

With respect to what NeoPa mentioned, I think Access database designers should look at what access could offer the users rather than what they could offer.

From what I have seen in many ACCESS forums is that designers are looking for changes beyond what MS access could provide while in actual fact the real solution that meets their requirement is in the tip of their nose and they are ignorant. Most questions asked are mere cosmetic, i.e. is not really necessary. This is not a good practice as working around cosmetic changes would dramatically eat away one's time.
Jul 6 '10 #5
NeoPa
32,556 Expert Mod 16PB
Jerry Maiapu: Most Newbie do not seem to reply to responses to their questions.
Why is that?. If someone is serous about getting their problem solved then I think they should follow posts and reply accordingly.
That can be for various reasons Jerry. Some have very little in the way of manners, but others get confused easily as they are unused to working within this medium. Still others don't check very frequently, possibly not expecting such prompt replies.

At the end of the day you will only make yourself unhappy if you rely on how other people behave. Remember, for every member short on manners, there are a number of other readers (members and otherwise) who can get benefit from your posts.
Jul 6 '10 #6
Jerry Maiapu
259 100+
Ok. It was just a personal comment.

Thanks for the clarification NeoPa.
Jul 6 '10 #7
Jerry Maiapu
259 100+
Oh ya I forget to thank you for creating a new threat for my Post:Count of working days
Jul 6 '10 #8
NeoPa
32,556 Expert Mod 16PB
No worries Jerry. You're fast becoming a very helpful member and I'm always pleased to do things for those of you that help out :)
Jul 7 '10 #9
Thanks for all of the answers! Sorry for the long reply time ( I try to reply Jerry...I feel your pain), we had a family tragedy that required an extended leave of absence. As to the solutions above, I think that the reason us newbies go right to code instead of bounds is that alot of us find sights like this while in school or training, and schools only teach what the course teaches. I never heard of a recordset once while in VBA/Access class! Bytes has been awesome in trying to get what school taught me and the real world merged into something useful.

I think the biggest problem with the bound forms that I haven't solved yet is how to bind the form, but not allow them to add a record to the table by tabbing through. The goal of my form is to allow them to view the records, but not actually edit them without clicking a "delete" or "add" button. I need to dumb this down to the level of people who still don't understand how to shut down a computer properly.

Thanks again for all of y'alls help.
Jul 9 '10 #10
NeoPa
32,556 Expert Mod 16PB
rnashting: I think the biggest problem with the bound forms that I haven't solved yet is how to bind the form, but not allow them to add a record to the table by tabbing through. The goal of my form is to allow them to view the records, but not actually edit them without clicking a "delete" or "add" button.
That's actually a very common confusion. As it's been asked, why don't I see if I can explain somewhat.

Actually, as it's so important, I just wrote an article to explain it. Have a look at Stop Bound Forms Updating Automatically.
Jul 9 '10 #11
Thanks again! I'm not in the office until tuesday, but I'm going to try to use this for a delete form too. We never learned a thing about the Form_BeforeUpdate event. Now that school is over I'm finding out how many things I wish they had taught us...

Thanks again!
Jul 9 '10 #12
NeoPa
32,556 Expert Mod 16PB
I'm afraid, now you're out of school, you'll find you're expected to learn a lot for yourself anyway.

School being fundamentally useless is actually good preparation for the adult world :D
Jul 9 '10 #13
Jim Doherty
897 Expert 512MB
@missinglinq
Here, here bravo Linq!!

What makes me smile many times is the assertion that just because you can make forms lightweight by rendering unbound as opposed to bound in favour of dealing with everything in a module with no form code that somehow you work more efficiently.

They never mention that by the time development finishes you are left with a module that is xxxxx thousand lines long and guess what! the developer moves on, someone else inherits the project and then sits for goodness knows how long unravelling a plate of spaghetti simply because that 'efficient' individual thought the advantages to be had from dealing with everything unbound were huge... oh! and by the way he left without ever documenting anything.

Use Access in the way it was intended! and stop worrying about the 0.010 efficiency gain from having something unbound and late binding.

The scaleability arguments for me dont add up, especially considering that at the end of a normal or usual software lifecycle the underlying language has probably dramatically changed so much anyway and you are most likely going to want to re-write the application particularly if you are upsizing.

I know I am off rather topic with this one but I couldnt agree with linq any more and simply had to drop this rant in

:)
Jul 11 '10 #14

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

Similar topics

4
by: Tim Marshall | last post by:
This is an embarrassing question to which I should know the answer, but I am not 100% sure of myself. My applications, whether they are Jet or Oracle usually deal with reporting on existing apps...
4
by: Skully Matjas | last post by:
I am using the following code (created by the wizard) to allow to bring my form to a particular entery. But when I edit the entery (ex: put new information into a blank cell), it puts that record...
2
by: uv | last post by:
Hi! I'm having problems submitting a new record through the form. I'm working with the wizard and I've added a control button to my form for entering entering a new record but for some reason it...
3
by: pelcovits | last post by:
I am trying to set up an unbound form to enter report criteria. I've followed the MS Office Assistance document: "Create a form to enter report criteria" which describes how to enter data (such...
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
4
by: Pierre | last post by:
Hi all, To ease load on a network i close automatically form open with a timer reset by user actions. If the time is expired i go through the collections of form and table and close all those...
6
by: jean.ulrich | last post by:
Hi I have a form that is not related with a table neither a query (unbound form) On this form I have a text field where the user can put a text or a number As I dont want to create a table...
11
by: TD | last post by:
I'm looking for input into my decision to switch to ADO and unbound forms. I get tired of having to block all of the ways a user can unknowingly save a record, like using the PageUp, PageDown keys...
7
by: troy_lee | last post by:
I have an unbound form. I have an Add New procedure that saves a new record to the database. What is the best way to update an existing record? In other words, clicking my "Submit record" button...
0
by: gershwyn | last post by:
In Access 2007, I am trying to add a button to my sata entry split form that will delete the current record, after prompting, but I am running into a bizarre issue. Here is the relevant code....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
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...

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.