Results 1 to 15 of 15
  1. #1
    Eddy Sincere is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2014
    Location
    Carson City, NV
    Posts
    114

    Error 2759 - Text Box linked to a combo box query returns error message when I sort on a split form

    I have started using text boxes to display information from a combo box query on a split form. The combo box will display (and change) an item number and the text bow will display the item description (can't change) (Attachment 1). It works perfectly (Attachment 2).

    However, when I sort the information on the split form by clicking the little triangle at the top of the column I get error message 2759 (attachment 3).

    When I click the OK button the sort finishes and the form works fine (attachment 4).

    I regularly compact & repair and haven't had anything go wrong. The error message only started showing up when I began using the text boxes. I'm concerned that I'm building an error into my DB and that it will eventually fail. Is this concern valid? Is there a way to avoid the error or fix something so the error doesn't appear?

    Attachment 1
    Click image for larger version. 

Name:	Search Field 01.jpg 
Views:	46 
Size:	107.1 KB 
ID:	19850


    Attachment 2
    Click image for larger version. 

Name:	Search Field 02.JPG 
Views:	46 
Size:	80.6 KB 
ID:	19851


    Attachment 3
    Click image for larger version. 

Name:	Search Field 03.JPG 
Views:	46 
Size:	101.8 KB 
ID:	19852


    Attachment 4
    Click image for larger version. 

Name:	Search Field 04.JPG 
Views:	46 
Size:	72.5 KB 
ID:	19853

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    hrm any chance you could create a sample database with some data in it to play around with, hard to tell (for me) without something to use since I don't use bound forms.

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by rpeare View Post

    ...any chance you could create a sample database with some data in it to play around with...
    I agree with this suggestion; to be honest, screen shots are very seldom helpful in trouble-shooting, as they show the 'what,' i.e. the end product in one case, without showing the 'how,' which is what you need help with.

    Is the field in question defined as one of the new multivalued Fields? I seem to remember that they cannot be sorted or (I think) filtered on.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    Eddy Sincere is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2014
    Location
    Carson City, NV
    Posts
    114
    Linq - Thanks for letting me know the screenshots don't add value! Is it better to just describe my situation and just avoid the shots altogether?

    Also, I've cleaned up the data and compacted and repaired the DB but am not sure how to post it. Can you give me some quick instructions?

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    Follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    Eddy Sincere is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2014
    Location
    Carson City, NV
    Posts
    114
    Here you go. Here's the pathway to get to the problem:

    COMPONENTS → Physical → Click on the triangle in the column heading to sort by the Item # → Sort A to Z → Error statement displays → Click "OK" → The statement disappears and the records are sorted

    The error statement only started appearing after I began using text field to display query data from a combo box. I can probably just get rid of the text field but they are super helpful.

    Ultimately, I'd like to get rid of the statement. I'd also like to know if I'm building in an error that will compound over time.

    Specifications - Post.zip

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    I do get the error when trying to sort on any field of frmTstCSpc. You are right, removing the expressions that reference combobox columns eliminates error.

    An alternative for displaying related data is to include tstP and mthd tables in the form's RecordSource. This will make the related data available. Bind textboxes to fields from tstP and mthd and set them as Locked Yes and TabStop No. Maybe even Enabled No.

    SELECT tstPSpc.*, tstP.TstP, tstP.MthdRcrdNmbr, tstP.CtgryTstRcrdNmbr, mthd.MthdDscrptn
    FROM mthd RIGHT JOIN (tstP RIGHT JOIN tstPSpc ON tstP.TstPRcrdNmbr = tstPSpc.TstPRcrdNmbr) ON mthd.MthdRcrdNmbr = tstP.MthdRcrdNmbr;
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    Eddy Sincere is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2014
    Location
    Carson City, NV
    Posts
    114
    I'll give that method a try if I can't figure out why the error message keeps popping up. While it seems a lot more complicated it's probably far more reliable. Thanks!
    Last edited by Eddy Sincere; 03-04-2015 at 06:19 PM.

  9. #9
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I haven't/don't used split forms, but what I find interesting is that if you go to

    GENERAL → Items → Click on the triangle in the column heading to sort by the Item # → Sort Z to A

    no error.

    If you try
    TESTS → Heavy Metals → Click on the triangle in the column heading to sort by the Item # → Sort Z to A

    no error.

    If you try
    COMPONENTS → Heavy Metals → Click on the triangle in the column heading to sort by the Item # → Sort Z to A

    errors.

    Maybe some corruption???



    PS
    Just curious....Is there a reason that table "tstA" does not have a PK? (why the autonumber field is not set as PK?)

  10. #10
    Eddy Sincere is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2014
    Location
    Carson City, NV
    Posts
    114
    Thanks for pointing out the lack of a PK, I've fixed it. A while back I switched from manual numbering in the PK to autonumbers and I must have forgotten to make the new field the PK.

    Regarding your observations, they are consistent with the problem I'm experiencing. The reason only one of the three forms you tried gave you the error message is that it uses a text field which displays data from a combo box. The other two forms do not use this type of field and, therefore, don't give the error.

    I'm trying to determine is using this type of field is going to cause long term problems, like corruption. It's weird because it gives the error and, as soon as the OK button is hit, the form acts normally. I really want to use this method of displaying data because it's easy and quick. But if I can't figure out the reason I'll switch to the method June7 mentioned.

    Also, I was just in another DB I built that uses the same text boxes tied to a combo box query and I don't get the error message when I sort. Very strange. Maybe your'e correct in that I have a corrupted table or DB. Maybe I should try copying the information into a fresh tables.

    Thanks for taking the time to look at my DB. As always, any observations are much appreciated. I'm still (very) new to this whole thing and want to improve.

  11. #11
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    You have a table "tstPSpc" and a field in the same table named "tstPSpc"???

    I see that in the "Heavy metals" table form also....

  12. #12
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I've been experimenting with your dB, mostly because I've never used a split form.
    I only messed (technical term) with COMPONENTS → Physical. (and changed the button color - easier for me to find)

    It is the two text boxes that are causing the problem. Deleting the two text boxes eliminates the error.

    Your form is based on a table.... I always use a query for form/report record sources, even if the query is based on one table.

    I created a query and changed the form record source to the query "query1".
    I don't know your naming convention, so you should rename the query.
    Now the sorting works without an error. (modified FE attached)


    -------------------------
    One other thing. I noticed the PK field for table "ItmNmbrs" is a text type field. It works, but not the best thing to do. If for any reason, the PK field gets changed, you will have a lot of orphaned records in the many side of the relationship. I always use an autonumber type field for the PK field.


    If you're interested, read these:

    Autonumbers--What they are NOT and What They Are
    http://www.utteraccess.com/wiki/index.php/Autonumbers


    Microsoft Access Tables: Primary Key Tips and Techniques
    http://www.fmsinc.com/free/newtips/primarykey.asp


    Use Autonumbers properly
    http://access.mvps.org/access/general/gen0025.htm

  13. #13
    Eddy Sincere is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2014
    Location
    Carson City, NV
    Posts
    114
    Interesting. A lot cleaner too.

    (Please forgive my ignorance) But isn't using a query a roundabout way to enter information into a table? Is the point that you do everything you can to prevent a user from accessing the table directly? Because you want to prevent any sort of (un)intentional tampering with the tables?

    Also, I know I broke a rule with the PK on the ItmNmbrs table but thanks for pointing it out. I had actually designed the entire bleedin' DB without auto numbers before I figured out I needed them. I went back and changed the everything but that one table. Because that table is linked to all sorts of stuff, changing the PK was just too much trouble and would require all the queries, tables, forms and reports to be revised.

    Please marked this thread as solved! Thanks a million.

  14. #14
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Code:
    But isn't using a query a roundabout way to enter information into a table?
    Not at all. Think of a query as a virtual table. Use the query just like a table.
    A form is still used to enter/edit/view data. In a query, you can sort by multiple fields and you can limit the records displayed. It is just something I've always done.

  15. #15
    Eddy Sincere is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2014
    Location
    Carson City, NV
    Posts
    114
    Just a quick follow up. I've created queries for my forms and everything is running much smoother. No more errors and the queries have a lot more flexibility. Thanks again for the help, it's been a lifesaver.

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

Similar Threads

  1. Replies: 5
    Last Post: 04-24-2014, 10:02 AM
  2. Replies: 1
    Last Post: 03-18-2014, 04:07 AM
  3. Val function returns #error on text/percentage
    By allenjasonbrown@gmail.com in forum Queries
    Replies: 1
    Last Post: 06-23-2013, 08:24 AM
  4. Linked Tables Giving Error Message
    By 18ck in forum Access
    Replies: 2
    Last Post: 11-23-2012, 06:30 AM
  5. Replies: 4
    Last Post: 02-22-2012, 12:43 PM

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