Unanswered: New record not being added to main form
I have created a database for another team in my organisation.
I have one form called 'New Requests', where users enter details of new requests being made to the organisation. This form contains 7 tabs.
I have another form called 'All Requests', which lists all requests made with basic details. These two forms are related by a PK called 'Record ID', which is an autonumber generated in the 'New Requests' form.
Users will sometimes only partially fill out the 'New Requests' form, and come back to it later to add additonal information. The problem is, is records that have only been partially populated are disappearing???? The 'Record ID' (autonumber), is increasing, but records are not being added to the main 'All Requests' form.
Can anyone tell me the reason for this? or how to rectify this, so that once a field in the form is populated it is added to the main form???
Are you creating this using VBA? Or just SQL queries?
I don't quite follow what you mean by:
The problem is, is records that have only been partially populated are disappearing???? The 'Record ID' (autonumber), is increasing, but records are not being added to the main 'All Requests' form.
Are you saying that if the forms details are only partially filled in, that the table isn't saving ANY of the details into its table? Or, are you saying that everything is saving alright to the table, but the 'All Requests' form is not updating with the information?
no. they are related forms, linked by the Record ID, which is the autonumber.
For example the 'New Request' form has say 50 fields. Users are adding a new request and only filling in the first 5 fields, to go back to later. Once they click 'Done' (a command button that saves the record and closes the form) the record should show in the 'All Requests' form. But its not. The Record ID number has been added, but the record is not showing? i.e. in the all requests form it goes Record 101, 102, 103, 105 - 104 missing!
Its as if not enough information is being entered for the record to count?
Is the information being saved to the table itself? Or is it just being dumped and not being saved anywhere at all?
If the table isn't saving the information, you have a problem with the 'New Requests' input. If the partial details and autonumber appears when you view the table, but doesn't appear on the 'All Requests' form, you have a problem in your 'All Requests' form.
Is the autonumbering still in the table, just all the other fields for that record are empty?
If so, then there's definitely a problem with the saving.
Access can be picky about using an 'INSERT INTO' statement, when encountering null strings.
Try setting the default value for all the inputs to " " (without the quotes), so basically just put a space in there. That will still give you issues if you have date and number fields though, so I would backup the existing table (save the backup as 'aTableName_') change everything to text (except the autonumber), and see if it saves a partial record with the default values with spaces.
If that works, then I'd suggest writting a short piece of VBA to check for vbNullString's in your inputs, and if any are encountered, to save a " " into the table.
You probably want to code a check for the OnClick() event for the 'Done' or 'Submit' button, checking to see if the mandatory fields have been filled in, if so, save as normal, otherwise, flag up a warning/message box/change back colour of the missing textbox values/etc, and await them to save again.
If you need some help with the code, just let me know the control names you've used for the required fields and the submit button and i'll jot something down for you.