By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,495 Members | 1,336 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,495 IT Pros & Developers. It's quick & easy.

How to add "Add button" in an Unbound form?

P: 3
Can any one pls explain how do i add "Add button" in an Unbound form?
4 Weeks Ago #1
Share this Question
Share on Google+
5 Replies


twinnyfo
Expert Mod 2.5K+
P: 3,055
VanitaJoshi,

Welcome to Bytes!

In order for any of us to provide you any meaningful advice, you will have to provide a much better explanation of what it is you want to do. Otherwise, we are unable to help you.
4 Weeks Ago #2

P: 3
Hi,
Am developing a database in MS Access(2016).
1. Have designed a form called " Outward Form" the data from which gets recorded in a table called "Outward".
2. And the mentioned form is Unbound to avoid the duplicate entry of the records into table.
3. HAve included "Save" button with VB coding to do so.
4. And now after saving the entered record to a table(i.e Pressing "Save" button) If the User wants to add another record he/she has to press "Add Record"(Which is inbuilt command), But due to some unknown errors the"Add Record" button is not working.
5. I have also attached screenshot of design view of the form for reference.
Need a solution!!

Attached Images
File Type: jpg Image.jpg (221.0 KB, 169 views)
4 Weeks Ago #3

twinnyfo
Expert Mod 2.5K+
P: 3,055
Thanks for a (somewhat) clarification....

1. You have an “Add Record” command button on your form. What is the code you are using behind that form? That may help. You say this is a built in command, but command buttons do not have built in commands—unless I did not understand your description.

2. If I understand the design of your form properly, since this is an unbound form, your user enters data, saves the data and the data is added to a table, yes? Then, shouldn’t the “Add Record” button simply clear all the controls on the form to allow the user to add new data? This is the only way to work with a truly unbound form. In theory, when you have an unbound form, there is no such thing as a “new record”, “add record” or anything else. In fact, there is no record at all—it is just data that is lost as soon as the form is closed (unless it is saved to a table).

I think I understand the direction you are trying to go, but we will work through this a bit slowly at first, just to make sure.

Hope this explanation hepps.
4 Weeks Ago #4

P: 3
Correct me if my understanding is Wrong,
As per your explanation an Unbound form does not have records, and the only way to clear and add the new data is to close the form and open again!.
4 Weeks Ago #5

twinnyfo
Expert Mod 2.5K+
P: 3,055
VaniteJoshi:
As per your explanation an Unbound form does not have records
Correct.

VanitaJoshi:
and the only way to clear and add the new data is to close the form and open again!
Not quite. This is one way to clear the data, but if your code clears all the controls, your data is gone.

The typical way to add data to a table is to use a bound form. It is highly irregular to do otherwise. You said in your first post that you are trying to avoid duplicate data, but there are ways of doing this with a bound form (as well as table structure) that will prevent duplicates.

Unless there is some absolute reason to use an unbound form, I would recommend a bound form.

But, if you want/need an unbound form, the purpose of your “Add Record” button will be to validate the data (that it is not duplicates) and then to add that data to the table. All this is relatively straightforward, but I don’t know what your VBA is doing now.

Hope this hepps
4 Weeks Ago #6

Post your reply

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