Search results

  1. MajP

    How to always set focus on the control on parent form after entering data in the subform

    My next guess is that the focus is first set and then something causes the focus to move away. Such as a pending event or pending code. To test Me.txtProductCode = Null DoEvents Me.txtProductCode.SetFocus Msgbox "Check to see if focus is set" One thing that can cause the main form to...
  2. MajP

    How to always set focus on the control on parent form after entering data in the subform

    That is a mistake on my part. The scanner emulates the keyboard so the after update does fire. I think that is the standard way to do it.
  3. MajP

    How to always set focus on the control on parent form after entering data in the subform

    That is not going to work since this code is obviously being called from the main form and in fact from txtProductCode txtProductCode_AfterUpdate()
  4. MajP

    VBA class modules & factory design

    That is pretty interesting and a lot of work! I need to dig into this more.
  5. MajP

    ListBox Doesn't Show Selected Values

    Well that makes the fix a whole lot easier.:)
  6. MajP

    Solved Looking to hide ribbon for forms but not reports

    In a standard module. Public Sub HideRibbon() DoCmd.ShowToolbar "Ribbon", acToolbarNo 'Hides the full toolbar End Sub Public Sub ShowRibbon() DoCmd.ShowToolbar "Ribbon", acToolbarYes 'Show End Sub Then in every form Private Sub Form_Close() ShowRibbon End Sub Private Sub...
  7. MajP

    ListBox Doesn't Show Selected Values

    1. You may want to run an update query to clean up your data by setting the new value to trim(old value) 2. In your data entry trim the data. Could do int the controls after update. 3. If these values are being imported from something then do the trim on the import process You caught it here...
  8. MajP

    ListBox Doesn't Show Selected Values

    Are you positive? Prove it by Set rs = db.OpenRecordset(sql1) debug.print Sql1 Now drop that SQL into Query window and verify it returns what you think.
  9. MajP

    ListBox Doesn't Show Selected Values

    To verify this match is not being Set? If true, a possibility is that there are spaces on one of these strings. You can add If trim(lst_Modalities.Column(0, i)) = trim(SelectedID) Then I would also double check that the If is not catching the match or if it is being caught but the list is...
  10. MajP

    ListBox Doesn't Show Selected Values

    How about try to debug? For i = 0 To (lst_Modalities.ListCount - 1) Debug.print "List Value: " & lst_Modalities.Column(0, i) & "Seleced: " & selectedID If lst_Modalities.Column(0, i) = SelectedID Then lst_Modalities.Selected(i) = True End If
  11. MajP

    Multiple member List

    Which is the same setup as Ken posted in thread 3, and I in thread 4.
  12. MajP

    How to Populate a Control in Code and Make it Behave As Though Populated in the GUI

    See if this does what you want. Double click Val 1 to set the value with the calculator (what I had laying around). If the value is greater than 100 it is valid. I left Null as also valid If you use the pop up and it is less than 100 then you cannot exit the control because you can cancel the...
  13. MajP

    Solved Gridlines

    On controls you can make the borders transparent or visible. They can have different colors, thickness, etc I am not sure of the horizontal line, but you can put a line control below your textboxes creating a repeating horizontal line.
  14. MajP

    How to Populate a Control in Code and Make it Behave As Though Populated in the GUI

    How about the AfterUpdate then If you set a value of a control neither the before or after update events fire. These only fire from a user action.
  15. MajP

    How to Populate a Control in Code and Make it Behave As Though Populated in the GUI

    MakeFormPick Me.Parent.Name, "frmCrdVendor-Pick", "cboDefaultVendorNo", "cboDefaultVendorNo", True, "fsubChild" Your pick form knows where to push the selected data. Can you modify that form to also set focus the to the control that was passed to the pick form when it sets the value. Then in...
  16. MajP

    Multiple member List

    Ken's "Mariages table" or "tblUnions" as I called it would still be a clearner way to do that and still maintain a history of marriages. In mine --Spouse1 --Spouse2 --MarriageDate --Status (Current, Annulled, Deceased spouse) In fact you will have to put some code and or indices so that the...
  17. MajP

    How to Populate a Control in Code and Make it Behave As Though Populated in the GUI

    Regardless if you have data validation at the control level, you still need a final trap at the form's before update event. You should always do this. Only way to ensure something does not sneak by. Additionally you can have validation on the controls so that you get immediate validation, but...
  18. MajP

    VBA class modules & factory design

    More interesting is I asked Chat when this was fixed and Chat says it was always available. So maybe it was one of those urban myths that I assumed was true for year and never bothered checking. Which is grate because this is exactly a case where an accessor is useful.
  19. MajP

    VBA class modules & factory design

    Interesting. I wonder when that was fixed. That used to be a problem. Glad to see it is no longer.
  20. MajP

    VBA class modules & factory design

    I would argue that if you are lazy (and have MZTools) then creating accessors (let, get, set) for all class variables save a lot of coding time. With MZTools it takes a second to create the accessors from a class variable, but now coding is much faster especially with larger classes. I do not...
Back
Top Bottom