Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2006
    Posts
    59

    Arrow Unanswered: Help with Counter

    hi

    i have a counter query which will add a column and will increase the value by 1 .

    Dim strSQL As String


    strSQL = "alter table mtm add column n counter (1,1);"
    DoCmd.RunSQL strSQL


    the above query starts from 1 and then adds one to the next record. what i want is that how can i
    set the starting value to another value like i want to pick this value from a table say tr_Num
    i tried the following but it doesent seem to work

    Dim strSQL As String
    Dim asdf As String
    asdf = DLookup("trade_number", "trade_number")
    strSQL = "alter table mtm add column n counter (asdf,1);"
    DoCmd.RunSQL strSQL

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Try this
    Code:
    strSQL = "alter table mtm add column n counter(" & asdf & ",1);"
    George
    Home | Blog

  3. #3
    Join Date
    Feb 2006
    Posts
    59
    hmm dint worked . i played with it but it dint worked. any other way

Posting Permissions

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