User Profile

Collapse

Profile Sidebar

Collapse
williamson1979
williamson1979
Last Activity: Apr 1 '22, 10:16 PM
Joined: Feb 9 '19
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • williamson1979
    started a topic Report Filtering

    Report Filtering

    Currently I have a report created from a query with a filter based on a single unbound listbox which is working. I tried to add a second unbound listbox for additional filtering but it is not functioning - no errors just literally seems to do nothing. The code that does nothing is a replica of the posted working code with exception of the control names. Any suggestions would be appreciated. Thanks
    Code:
    'Private Sub listbox_AfterUpdate()
    ...
    See more | Go to post

  • williamson1979
    replied to Set Visibility of Subform controls
    Thanks isladogs - sorry for the mistype. Yes NeoPa I think I made positive headway with the suggestions and advice in this thread. At the very least I was able to take this information to build a nice cascading menu and delete the built in navigation form which eliminated some errors. Much appreciated.
    See more | Go to post

    Leave a comment:


  • williamson1979
    replied to Set Visibility of Subform controls
    Hey islagogs and NeoPa,

    Taking what isladogs said about the access navigation form I removed it from my DB and created my own that I'm much happier with. By doing so I was able to get rid of several issues in my DB. As of this time everything is working as expected related to this thread. I currently just have the visibility code in "blocks" but I will retouch the tags once I have progressed more. I need to learn more on...
    See more | Go to post

    Leave a comment:


  • williamson1979
    replied to Set Visibility of Subform controls
    Yes I can do that when I'm back at the computer. I think you might be spot on about using the access navigation form from errors I'm getting from unrelated forms once in the nav form.
    See more | Go to post

    Leave a comment:


  • williamson1979
    replied to Set Visibility of Subform controls
    Hey I have changed the tg1, tg2 etc back. Everything else was as is in your code after I experimented trying to get it to work. I wanted to names I could easily remember.

    "Trying to modify code without fully understanding it will always lead to problems." I had it copied in notepad but without experimenting I had no other way to try and learn how it worked. I modified also after I was getting errors. To me the tg1 etc seemed...
    See more | Go to post

    Leave a comment:


  • williamson1979
    replied to Set Visibility of Subform controls
    I made updates. I now get error 438 when opening the form as well as error 2165 with several controls hidden when opening with my navigation form and it does not work at al (PS my navigation buttons are now hidden, I added the tag unused but no change)l. Error 2475 when I open the form directly. Click that error away 3 times it loads with missing controls. After making a choice from the combobox it works as desired. I had posted earlier on this,...
    See more | Go to post

    Leave a comment:


  • williamson1979
    replied to Set Visibility of Subform controls
    isladog,

    Ive experimented with the tag feature you suggested. I created a module using your link and modified it slightly
    Code:
    Option Compare Database
    Option Explicit
    
    Global ctrl As Control
    
    Public Sub ShowControls(State As Boolean, tagmotor As String, Optional taggearbox As String, Optional tagbearing As String)
    
    On Error GoTo Err_Handler
    'set controls to visible or not according
    ...
    See more | Go to post
    Last edited by williamson1979; Feb 16 '22, 09:34 PM. Reason: Experimented with the code. Update question

    Leave a comment:


  • williamson1979
    replied to Set Visibility of Subform controls
    Yes you are correct isladogs, mvf. Ultimately Im trying to track currently used parts & inventory what is on the shelf. I can sort them with location, manufacturer, part numbers, type of part but without many tables I'd be left with a field that could describe the specifications in more detail. I did write out some specs of the different parts to see if I could cut down the number of tables needed but there is just not enough in common to do...
    See more | Go to post

    Leave a comment:


  • williamson1979
    replied to Set Visibility of Subform controls
    Neopa and isladogs thanks for the help. I tried to set the focus but not the correct way as you all have mentioned.

    Isladogs I did read some on what you have been posted. I do not think I fully grasp how to do it but the logic of it makes perfect sense.

    In regards to varying fields I believe I can simply the table to contain a common set of fields with a additional field to hold specific details. My biggest worry doing...
    See more | Go to post

    Leave a comment:


  • williamson1979
    replied to Set Visibility of Subform controls
    I've read the linked post. I semi have the visibility working. I now have a error 2165 "You cant hide a control that has focus." The code is in the main form. Error is always on
    Code:
    Me.[subplantpartext].Form![txtppgsize].Visible = False 'Hide Gearbox
    regardless of the Case selected. So how would I get that to lose focus?
    Code:
    Private Sub cbopppartLK_AfterUpdate()
    Select Case Me.cbopppartLK
    Case "Bearing"
    ...
    See more | Go to post

    Leave a comment:


  • williamson1979
    replied to Set Visibility of Subform controls
    Thank you I will read the link. I had thought of this as well but did not want to post too many questions at once.
    See more | Go to post

    Leave a comment:


  • williamson1979
    replied to Set Visibility of Subform controls
    Thanks for the reply. I will follow the link you have posted and hopefully find a solution. My question probably should have been how to reference a control in a subform from a combobox in the main form. If I select a choice in my combobox i want it to hide certain controls while leaving other controls visible. I can only make this work if my combobox is in the subform. I tried
    Code:
    [Forms]![MainFormName]![ComboMainFormName].[Form]![TextboxSubFormName].Visible
    ...
    See more | Go to post

    Leave a comment:


  • williamson1979
    started a topic Set Visibility of Subform controls

    Set Visibility of Subform controls

    Hello,
    I'm trying to set the visibility of controls in a subform with a combobox in the main form. I had it working but i needed to move some table fields from the sub to the main. Ive tried researching but Ive had no luck in finding an answer that is related to the controls directly.
    This is what previously worked when the combobox was on the subform.
    Code:
    Private Sub cbopppartLK_AfterUpdate()
    Select Case Me.cbopppartLK
    ...
    See more | Go to post

  • williamson1979
    replied to SetFocus on Tab Controls
    Will the afterupdate() respond when the control button has tab pressed on it?
    See more | Go to post

    Leave a comment:


  • williamson1979
    replied to SetFocus on Tab Controls
    OK so after I figured out it was a issue with one of those tabs I looked at everything. It was definitely just that. Id added a unbound txtbox that had changed my controls tab order setting the cmdButton to go to tabPG at 0.

    With that said since Ive already posted my code which set is the best to use for navigating tabControl?
    See more | Go to post

    Leave a comment:


  • williamson1979
    replied to SetFocus on Tab Controls
    I also tried this as well and removing all previous posted code:
    Code:
    Private Sub cmdGoToFuel_Enter()
      tabPlantReport.Value = (tabPlantReport.Value + 1) Mod tabPlantReport.Pages.Count
    End Sub
    Private Sub cmdGoToPG_Enter()
      tabPlantReport.Value = (tabPlantReport.Value + 1) Mod tabPlantReport.Pages.Count
    End Sub
    Once I add cmdGoToPG the same thing happens, it skips over tabFuel. I believe I must have a issue with...
    See more | Go to post

    Leave a comment:


  • williamson1979
    started a topic SetFocus on Tab Controls

    SetFocus on Tab Controls

    I'm having difficulty with my tab control. A) Its difficult to switch to the correct tab by clicking it as it might take several attempts so I added
    Code:
    Private Sub tabPlantReport_Change()
    . B) When the button cmdGoToFuel is entered (Its the last tab position to send the tab control to the next page tabFuel) it goes to tabPG, however if I remove the vba for cmdGoToPG then it works.I cant seem to figure it out. C) As I stated I added
    Code:
    Private Sub tabPl
    ...
    See more | Go to post
    Last edited by NeoPa; Apr 13 '19, 03:03 PM. Reason: Updated title.

  • williamson1979
    replied to Subform Sum error
    Sorry Neo for 3 post in a row. Since your response to where is the code got my brain spinning I might have fixed it. In the query I entered this
    Code:
    IIf([ProdTotal]=0,0,[HeatNGUsed]/[ProdTotal]) AS HeatNGTon
    for 1 of the instances I was speaking of and it now shows 0.0 rather than Div/0 error.
    See more | Go to post

    Leave a comment:


  • williamson1979
    replied to Subform Sum error
    Code:
    [AsphUsed1]/[ProdTotal] AS AsphPerc1

    Since you mentioned SQL I started looking into the query for the report. The above code apparently did not update with my changes in the form as the one you first helped me on. Is it ok to just edit the SQL directly to show
    Code:
    IIf([txtProdTotal]=0,0,[txtAsphUsed1]/[txtProdTotal])
    See more | Go to post

    Leave a comment:


  • williamson1979
    replied to Subform Sum error
    Is it SQL when it’s entered into the forms property box? That was copied and pasted directly from there once I clicked on the text box, view properties, control source. All 5 are in my main report form. They are all exactly the same except what’s being divided by the ProdTotal. I thought it seemed fine from what I’d already did and what you showed me except yours involved a multi step calculation where this one does not. Just the one you did...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...