Consulting

Results 1 to 6 of 6

Thread: Strange behavior VB editor

  1. #1
    VBAX Regular
    Joined
    Jan 2016
    Posts
    35
    Location

    Strange behavior VB editor

    Hello,


    In my DB, is a form named “frmWareHouse”, in that form is a subform that has the name “subfrmWareHouse”.

    When I look in the VBA editor, at my code then the editor sees the name of the subform with a capital first letter.
    The editor says “SubfrmWharehouse” but my formname is just “subfrmWhareHouse”.

    I looked for a solution to solve this problem, but cannot find it. Its creates al lot of error messages.

    When I try to change de first capital letter, into a small letter, and I click in the procedure somewhere else, then
    the first letter jumps automatically back to a capital letter.

    Forms!frmWareHouse!SubfrmWhareHouse.requery (acces cannot find the form).

    The correct code is off course

    Forms!frmWareHouse!subfrmWhareHouse.requery

    Any help would be gratefull,
    Greetings,
    TonC

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Don't argue with the VBE... Change the Sub Form name to a Cap letter

    Or try completely different names...MasterFormWarehouse, Master_WarehouseForm, Sub_warehouseForm, WareHouseSubForm, frmWarehouseSubForm, frmWarehouseMaster...
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  3. #3
    VBAX Regular
    Joined
    Jan 2016
    Posts
    35
    Location
    Okay, good advice

    But I have also another form, with the similar names, and there sees the VBE the proper names of the forms. Its not logical to make a difference in the names of the forms.
    I will not argue with the VBE.

    Thanks for the help

  4. #4
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    I suspect that somewhere in the code is a reference to "SubfrmWhareHouse."
    You might try, First temprarilychange the Form Name to not be referable, such as XSubXfrmWhareHouse

    Then Using Ctrl+H, Find and Replace all instances "in the Project" From "SubfrmWhareHouse," Ignore Case, to subfrmWhareHouse.

    Finally,rename "XSubXfrmWhareHouse" itself back to subfrmWhareHouse
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  5. #5
    VBAX Regular
    Joined
    Jan 2016
    Posts
    35
    Location
    Hello SamT,

    I must make my apologies, because the problem was caused by myself. The form name was an old form name and not the new form name. It makes me more attentive for the future to look carefull at my vba code and the associated form names.

    But anyway,
    Thank you very much for trying help.

  6. #6
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    YW. That's what we live for.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

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
  •