Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Nov 2001
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    default number in brackets (Access 2000)

    I want to build a function giving the default number in the brackets. I have to write each time the same lines and give different default values
    The function i use now is called MyDefault :
    ' example for default number 4 :
    Public Function MyDefault()
    DoCmd.OpenForm "FMain", acDesign
    Forms!FMain!Classes.DefaultValue = 4
    DoCmd.Close acForm, "FMain", acSaveYes
    End Function

    Is it posible to rewrite this function and put the default value in the bracket and to call this function for example:
    Call MyDefault(7)
    In order to get the default value of 7 in the main form ?

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: default number in brackets (Access 2000)

    Try this, if I get what you are asking:

    Public Function MyDefault(intDefNo as Integer)
    DoCmd.OpenForm "FMain", acDesign
    Forms!FMain!Classes.DefaultValue = intDefNo
    DoCmd.Close acForm, "FMain", acSaveYes
    End Function

  3. #3
    2 Star Lounger
    Join Date
    Nov 2001
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: default number in brackets (Access 2000)

    Thank you. Thats what ihave asked

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •