Page 3 of 3 FirstFirst 123
Results 31 to 40 of 40
  1. #31
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    You do not need to repeat the catType in the subcat table, that is what the keys are for.

    I have no clue what is going on here, but I am unable to upload any files?



    You do not requery the query, you requery the recordsource of the combo, by requerying that control.

    Code:
    Private Sub COMBOcatTP_AfterUpdate()
    Me.COMBOsubC.Requery
    
    
    End Sub
    Right. Tried with Firefox.
    That gives me an error message that file is too big. I get nothing in Chrome?, so no clue as to why it does not upload.
    Even when zipped, I cannot upload the file?

    Finally managed to upload with Firefox. What a palaver
    And no, no file uploaded. Had to go back in, and as it was in the list, I could drag it to the upload window.
    Attached Files Attached Files
    Last edited by Welshgasman; 09-03-2023 at 07:36 AM.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  2. #32
    davegri's Avatar
    davegri is offline Excess Access
    Windows 11 Access 2019
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    Here is the complete code for the form in the DB post #23.
    It wasn't clear how the OP's "trouble shooting" code snippet would be used (perhaps OP meant "Error Handler code"), so I just included it in a sub named "TroubleShoot" and called it from within a couple of the indicated events.

    Code:
    Option Compare Database
    Option Explicit
    
    
    Private Sub cboCategory_AfterUpdate()
        On Error GoTo cboCategory_AfterUpdate_Error
        Dim sSource As String
        sSource = "SELECT [subCATEGORIES].[SubCategoryID], [subCATEGORIES].[CategoryID], [subCATEGORIES].[subCAT]  " & _
        "FROM subCATEGORIES " & "WHERE [CategoryID] = " & Me.cboCategory
        Me.cboSub.RowSource = sSource
        Exit Sub
    cboCategory_AfterUpdate_Error:
        MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure cboCategory_AfterUpdate, line " & Erl & "."
    End Sub
    
    
    Private Sub cboSub_AfterUpdate()
        On Error GoTo cboSub_AfterUpdate_Error
        Me.subCATEGORY = Me.cboSub.Column(2)
        Exit Sub
    cboSub_AfterUpdate_Error:
        MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure cboSub_AfterUpdate, line " & Erl & "."
    End Sub
    
    
    Private Sub TroubleShoot()
        Dim Msg, Style, Title, Help, Ctxt, Response, MyString
        Msg = "Do you want to continue?"
        Style = vbYesNo + vbCritical + vbDefaultButton2
        Title = "MsgBox Demonstration"
        Help = "DEMO.HLP"
        Ctxt = 1000
        Response = MsgBox(Msg, Style, Title, Help, Ctxt)
        If Response = vbYes Then ' User chose Yes.
            MyString = "Yes"
            ' Perform some action.
        Else ' User chose No.
            MyString = "No" ' Perform some action below.
            GoTo Exit_bail:
        End If
    Exit_bail:
        Exit Sub
    Err__testing:
        MsgBox Err.Description
        ' Resume COMBOcatTP_AfterUpdate
        GoTo Exit_bail:
        DoCmd.Close
        DoCmd.OpenForm "originalresourceinputform"
        ' originalresourceinputform.show
        '-----------------------------------------------------------------------
    End Sub
    
    
    Private Sub Description_Click()
        Call TroubleShoot
    End Sub
    
    
    Private Sub Form_Current()
        Call TroubleShoot
    End Sub
    Note to ZEVVER:
    If this code is pasted into an existing DB's form, the form will know nothing of the new events introduced in the code.
    You will need to ensure that for example, the Description_Click event exists on the form's property sheet, and clicking on the 3 dots will actually go to that event in the new code.

  3. #33
    ZEVVER is offline Novice
    Windows 10 Access 2007
    Join Date
    Aug 2023
    Posts
    16

    it might work on your machine, but it does not work on mine

    Guys,

    You are all brilliant coders, but in your rush to ignore all my typed explanation and inyour rush to get to the code and get it over with, you are missing the point entirely.

    1) I added Me. to the requery - - - the cbox still does not work
    2) the msgbox trouble shoot is not part of my design, I merely inserted in to illiustrate nothing works on my end - the problem has nothing to do with combox code
    3) I uploaded a new version of the DB. I deleted all the events, 100% and started building the events over again. I even go tthe select code builder pop up
    To Davegri's point, I did do a lot of pasting (I wondered about that not linking to properties - seems totally ridiculous that the software engineers don't allow for that )

    If you open the latest upload version THEN You will see I have only 2 events

    FORM CLICK me.combosubc.requery
    CATEGORY CONTROL me.combosubc.requery


    4) The 2nd box in the cascade still does not work. Neither on the current record nor on the moving to a different record and returning. It only works when closing the form and reopening the form, the first time and only the first time

    The problem is not the code. I mentioned the DB is stored on a partition, but trying it on C: does not work either.
    There is some other issue, other than the code.

    You try my upload. If it works fine on your machine - I am telling you it does not work on mine. WHY?
    Attached Files Attached Files

  4. #34
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Did you try my uploaded db?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #35
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    I have amended this one as well.
    If you change control names, you need to also change the names in the code.
    Attached Files Attached Files
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  6. #36
    ZEVVER is offline Novice
    Windows 10 Access 2007
    Join Date
    Aug 2023
    Posts
    16
    Quote Originally Posted by Welshgasman View Post
    Did you try my uploaded db?
    DOWNLOAD? Did I download your db?
    YES sir. It opened as readonly. But frankly, it does not work on existing records, so why risk unlocking the read only for viruses attached on the way down to my machine?


    Are you saying your code works on your machine? Really? If you move record to record, the value in subcategory changes?

    Not on my machine.

    If I scroll through the form, when the category changes, the subcategory drop down does not !

    Furthermore, your DB left out FORM Current ( )

    me.combosubc.requery should be at the form level cureent() also.

    So I added it, even though you left it out.

    No difference. the second combobox does not change values.

    sounds like you did not try my latest version uploaded this morning. You did not say if it works on your machine,

    I appreciate whatever time you are spending on my issue. Look, you are volunteering, I get it.
    You don't get paid for this, I figure.

    It is obviously frustrating that everyone is stumped.

  7. #37
    ZEVVER is offline Novice
    Windows 10 Access 2007
    Join Date
    Aug 2023
    Posts
    16
    WOW

    I opened up gasman RESOURCE ARC

    1) your drop downs do not change, record to record
    2) why are you changing the name of the BAIL drop down - you don't get what it illisutrates, apparently
    3) it is the FAILED dropdowns that need fixing - you missed the point
    4) anyway, even with you changing the combox names needlessly, they still don't work

    Are you telling me that when you move record to record, the subcategory drop downs change on your machine? Di

  8. #38
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Listen.
    All we need is the minimum to work with.

    Your first DB only had two combos. Once you get the hang of setting one on the condition of the other, you just repeat the logic.

    There was nothing in Current, so do not balme me. I took nothng out. On the first file I did have to, either comment or delete the Requery code line, and it just kept erroring asking for an object.
    You appear to be worried about viruses on uploaded files, yet want us to download yours and trust you, and you have just joined?

    I have already mentioned that my Chrome is not allowing me to upload files, so I have to use Firefox. So I have to go the extra mile to upload and you are complaining about a possible virus?

    The combos are bound, so once you move record you get the new data. Now if there is nothing in that data, that is your problem. You should be ensuring you cannot move to a new record or exist the form unless all your data required has been entered.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  9. #39
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    I am away in Michigan so not feasible for me to look at any of this via phone.
    Last edited by Micron; 09-04-2023 at 07:34 AM.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  10. #40
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Quote Originally Posted by Micron View Post
    I am away in Michigan so not feasible for me to look at any of rhis pna phone.
    You are not missing anything Micron.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

Page 3 of 3 FirstFirst 123
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 02-21-2018, 01:32 AM
  2. Replies: 7
    Last Post: 03-02-2016, 09:17 PM
  3. populating field in form based on input field
    By BrandonFinn in forum Forms
    Replies: 7
    Last Post: 10-30-2014, 10:45 AM
  4. Replies: 1
    Last Post: 11-15-2013, 11:42 PM
  5. Replies: 4
    Last Post: 04-26-2012, 11:04 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