Results 1 to 8 of 8
  1. #1
    Join Date
    May 2011
    Posts
    10

    Unanswered: New record not being added to main form

    Hi!

    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???

    Please help!!!

    Harriet

  2. #2
    Join Date
    Jun 2011
    Location
    Inside your mind
    Posts
    297
    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?

  3. #3
    Join Date
    May 2011
    Posts
    10
    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?

    Does this make sense?

  4. #4
    Join Date
    Jun 2011
    Location
    Inside your mind
    Posts
    297
    It does indeed.

    What does the table look like?

    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.

    Check it out and let me know.

  5. #5
    Join Date
    May 2011
    Posts
    10
    No, the information is not being saved in the table either. Its as if its just being discarded because theres not enough information to make it count as a record?

    I don't even know where to begin to look for the problem? Is there some sort of code i could write to say once the first field has been populated, count it as a record?

    As soon as anything is written on the form, the automnumber is created, should these not mean that it creates a record?

    Am i being dumb?

  6. #6
    Join Date
    Jun 2011
    Location
    Inside your mind
    Posts
    297
    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.

    Hopefully that makes a bit of sense...

  7. #7
    Join Date
    May 2011
    Posts
    10
    No the entire record is missing, as if it never existed?

    I have some fields set as 'Required', would this affect it? i.e. if a user quit the form before filling in the 'Required' field, it wouldnt save?

  8. #8
    Join Date
    Jun 2011
    Location
    Inside your mind
    Posts
    297
    It would indeed.

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •