Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2004
    Posts
    178

    Unanswered: ComboBox notInList

    I found this code for notinlist event but I want to add is to ask the user for a country code whish will also be stored in the table under [CountryCode]
    which will be a max of 3 char big

    intAnswer = MsgBox("The Country " & Chr(34) & NewData & _
    Chr(34) & " is not currently listed." & vbCrLf & _
    "Would you like to add it to the list now?" _
    , vbQuestion + vbYesNo, "Country")

    If intAnswer = vbYes Then
    strSQL = "INSERT INTO Country([Country]) " & _
    "VALUES ('" & NewData & "');"
    DoCmd.SetWarnings False
    DoCmd.RunSQL strSQL
    DoCmd.SetWarnings True
    MsgBox "The new Country has been added to the list." _
    , vbInformation, "Country"
    Response = acDataErrAdded
    Else
    MsgBox "Please choose a Country from the list." _
    , vbInformation, "Country"
    Response = acDataErrContinue
    End If

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Or alternatively why not populate you country table with the iso 3 digit country codes from day one and avoid the anarchy of users making up their own codes......
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Aug 2004
    Posts
    178
    I don't know the 3 digit code and they will be told what it is they may only need to do this once a year and once the country is added it wont be added again.

Posting Permissions

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