• default number in brackets (Access 2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » default number in brackets (Access 2000)

    Author
    Topic
    #398978

    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 ?

    Viewing 1 reply thread
    Author
    Replies
    • #767010

      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

    • #767011

      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

    Viewing 1 reply thread
    Reply To: default number in brackets (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: