Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2006
    Posts
    10

    Unanswered: Query causes new record to be disabled on a form?

    I'm creating an application to monitor bookings. Previously I've been using a field to show the available places, and this is manually decremented by macro when a booking takes place.

    I'm getting rid of that, as the available places can be shown by a query, using the relationship between max places, and a count of the bookings made so far. More integrity this way.

    I have the working query and want to add it to the booking form, but when it is included in the form, data entry on the booking form becomes disabled and I can't create new bookings.

    I tried adding a text box to the form and setting the data control source as the required field from the query where the query looks up a bookingid from the form... but all I get is #name? in the box. If I run the query from the objects menu while the form is open, it will display a table with the correct details.

    Is there a way to show this available places query on the form without this problem happening?

  2. #2
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    My guess would be that your query is returning a non-updateable recordset.
    If it uses any aggregate function (MAX, COUNT), you can't change the data
    in the fields.
    Inspiration Through Fermentation

  3. #3
    Join Date
    Dec 2006
    Posts
    10
    Yeah that's what I guessed was happening.

    I can get this to work by using a subform, but it seems like a strange approach when I'm only wanting to display one field in the subform. Feels like a band-aid fix, rather than a proper solution... or is that how it would normally be done?

  4. #4
    Join Date
    Dec 2006
    Posts
    10
    edit: The more I bang my head off the monitor, the easier it gets.
    Last edited by Snykch; 12-12-06 at 14:15.

Posting Permissions

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