A few problems with a data entry form.

fantimm

Registered User.
Local time
Today, 15:24
Joined
Jul 27, 2007
Messages
11
Hey everyone.

I am making a simple database for my work, and I could use a little help with the forms. I did do a bit of databases back at university but am pretty rusty.

Anyway, I am setting up an entry form to add a new entry to a table called "Rigs". Each rig in the table has an auto-number for its primary key.

Firstly, could you guys let me know how I make sure that the entry form doesn't show data from the table? I am pretty sure I have it fixed by setting "allow deletions" and "allow edits" to No, and setting "Allow Additions" and "Data Entry" to Yes. It just took me a lot playing around to get it how it is and I wanted to check that it was in fact those settings that got it working because I will be doing a lot of other entry forms.

OK, so my first proper problem is that whenever you enter any data into the form, the record is instantly added. So if you only enter one field, and then close the form, a new record is added with only that one field. I want to make sure that the new record is only added if they click the "Add new record" button down the bottom. When I am done I will probably get rid of the little cross up the top to close the form, so maybe there is something I can put in the code for my "Close" button that will delete the record? Even though this will mean that an ID number will be consumed I am not that bothered. But I would prefer it if there was some way that the record would just not be added at all until the "add record' button was clicked. Any suggestions?

Another thing, is that I have the field "Rig Type". Now in my form I have a combo box with options in it such as "Large Rig", "Small Rig" etc. with the last option being "Other". When "Other" is selected a text box should appear next to the combo box for the user to input the value they want stored. I have already used a macro to make the text box appear, which is fine, but I need to make sure that the correct value is being stored in the table because I don't want the value "Other" from the combo box to go into the table, I want whatever is put in the text box. I tried adding into the macro some commands to change the Control Source of the combo box and Text box but I got an error saying that I couldn't change Control Sources. So now what I have done is I have an invisible text box down the bottom, it has its control source set to "Rig Type" and the other two are now unbound. I have successfully managed to set it up so the combo box has a macro performed after an update which sets the invisible text box's value to whatever is in the combo box (unless the combo box has "Other" selected). So I THINK that now all I need to do is set it up so that if the combo box DOES have "Other" selected, it should save the text box's value to the invisible text box (I hope that made sense). Anyway, so I was wondering, is this the best way to do it? And when should I have it apply the Macro? (after update, Dirty etc,).

Sorry its such a long post. Hope Someone can help me out.
 

Users who are viewing this thread

Back
Top Bottom