Adding New Records

Sol

Registered User.
Local time
Today, 01:52
Joined
Feb 24, 2000
Messages
31
When reviewing/adding records in a form, the record selector is always at record 1 of n. How can I set it so when the user opens the form, they are at a blank record?

Thanks!
Sol
 
Open the form in Design View and on the forms Property Sheet select the Data tab. Find the Data Entry field and set it to Yes. Now your form will always open at a new record.
 
I'm having this same issue. I switched Data Entry to Yes, and am now coming into a blank record; however, it's still saying 1 of 1. I want it to say 4 of 4, or 5 of 5, whichever number the new record represents. Also, I want to be able to use the record arrow buttons to click to previous records. Now; however, it's not indicating any previous records - Just 1 of 1. Any suggestions?
 
Set DataEntry to no and on the form load event, include the following line of code. This will always bring you to the new record first.

DoCmd.GoToRecord , , acNewRec
 
MLILLEY - Thanks so much for your response! I put that code into the On Load property, but I'm now getting the error, "Cannot Add or change records because a related record is required in the Customers table." I have the CustomerID as the primary key, AutoNumber in the Customer table, and as foreign keys in every other table. I don't know why I'm getting this error. Also - My form properties is set to Dynaset Inconsistent, because I want to populate the Form view with what's on my tables, as well as populate my tables with what's in Form view. Any ideas? Thanks!!
 
Are you working with a subform or a popup form or ...? I had a very similar problem when I wanted to add new records to a pop up form so I might have some insight if I know your exact situation.
 
No, there's no subform or popup form involved. I have a form based on a query. The query itself runs fine. And it also ran fine as the Record Source in my form. A couple properties for my query (don't know if these matter or not): Recordset Type: Dynaset, Output All Fields: No. I don't know if the problem is with this query, or with the form itself. I've tried many different combinations. And I can't just refer to the property settings in my other database forms, because none of them are based on queries. I'm totally puzzled. ??????
 
So, if I understand you correctly, your form is based on a query that works fine by itself but when you use the form to view your records through the query, you can't view any records (you said that your form didn't show any previous records). Is this correct?
 
O.K. - Let me try to explain: I designed all of my tables, and then went into each table and entered one record into each (to ensure that my tables were working properly). I then designed my form. Upon opening my form, I could see my data in each field. (Only one record, because there's only one record in each table. - Each field in each table has a place on my form)So, I go and enter my second record in Form view. It says record 2 of 2 (as it should say); however, when I go to save it, I get the message I described above. Make sense?

[This message has been edited by Melody (edited 12-06-2000).]
 
Is it because the record has not been saved?
i.e. If you are working on a form and you haven;t told it to save and haven't exited the form then I'm sure it won;t have been saved in the table.

Try putting a save button on the form and try again.

It also might have something to do with the default value settings for linked fields.

For each 'sub'table on the form make sure the default value of the linked field is set to the correct field - the master file primary id.

Might be relevant, might not..

Ian
 
Another suggestion...

Try putting a save button the form and save at an appropriate point - as I recall unless you physically tell the form to save or close it then the data is not transferred to the tables and therefore the reference will not exist that you are linking to.

Ian
 
Thank you everyone for your responses.
FORNATION - No, it's not because the form hasn't been saved. I do have a save button. It saves fine. I don't actually get the message until I try topage back to the previous record.

I'm confused as to what you mean by the link fields. There are no properties called link fields on my form. However, there are some on my query. There isn't a drop list though, so I wouldn't know what to type even if it was relevant (which I don't believe it is).

One thing I'm puzzled at is the error just says "must have related record in customer table". I'm wondering why it's just referencing the Customer table, when I have about five other tables besides this one that are in the query my form is based on. ????????? I'm lost!

Thanks again for all your input!
 
Sorry, Melody - didn;t mean to be patronising - my PC was having a fit so I didn;t know that I'd sent a message already.

If you need help e-mail me.

Ian
 
FORNATION - I didn't take your post as patronizing. I thought that was a valid question. I was just letting you know that "no, that's not the reason". Because we're just typing, it's hard sometimes to interpret what people are saying. Sorry!

Anyway - I feel like a complete idiot! I was trying to base a form on a query, and I wanted to be able to update my tables with this form. I realized this can't be done, because HELLO - It's based on a QUERY! So sorry for wasting everyone's time!!!!

So - Now I need to correct this problem. I have a very well designed form which took me LOTS of time, and I don't want to do it over. I need to know if this can be done: I want to enter data into this form, then have the data go out and populate all of my different tables. Is this possible without using subforms? I keep getting the #Name? error in all of my controls. The field each control is referencing IS in the correct table, they aren't calculated controls or expressions. ????????

Thanks again!!
 

Users who are viewing this thread

Back
Top Bottom