Results 1 to 2 of 2
  1. #1
    TimSG is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    6

    Limit Datasheet Subform to just one record.

    I apologize if this is in the wrong Forum - I wasn't sure if this should be in the Form or the programming forum. I have a Form with a subform that is a datasheet that ties to a table. What I need to do is limit only one record for that particular form/subform combination. The main form gives a Quote number and the date of the quote, while the subform contains other fields tied to other tables. They are tied to the other tables where they can select the data they need (Like product, or salesman).

    So, I need the subform to only list one record. I need it to allow to add a record when there are no records and only allow editing when a record exists. My forms are titled Quote and Quote Subform - how original.

    I've checked on this forum and didn't see anything that was similar (but maybe I am blind) and also checked the interweb and only found one example that didn't seem to work for me.



    Can someone point me in the right direction?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    set the query of the subform to show only 1 record by:
    use top 1,
    or
    use a key on the subform so only that 1 record shows,

    you can set the subform property to ALLOW NEW RECORDS, if rec.count = 0
    then ALLOW NEW RECORDS = false if rec.count>0

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 09-08-2017, 07:18 PM
  2. Copy a Record in a Datasheet Subform
    By Bentley in forum Forms
    Replies: 2
    Last Post: 09-05-2017, 12:26 PM
  3. Replies: 8
    Last Post: 08-26-2012, 11:11 PM
  4. Replies: 5
    Last Post: 02-06-2012, 03:58 PM
  5. Replies: 16
    Last Post: 01-16-2012, 09:43 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums