Results 1 to 4 of 4
  1. #1
    Join Date
    May 2008
    Posts
    1

    Unhappy Unanswered: help required in VB6

    I am a fairly new VB6 programmer. I am having a problem. The code behind datacombo - dcoLocation1 is given below.


    Code:
    Private Sub dcoLocation1_Click(Area As Integer)
        Dim Loc1Name As String
        DataEnvironment1.rscmdLocation.MoveFirst
        DataEnvironment1.rscmdLocation.Bookmark = dcoLocation1.SelectedItem
        Loc1Name = DataEnvironment1.rscmdLocation.Fields(1).Value
        txtLocationName1.Text = "Name: " + Loc1Name
    End Sub
    When run it gives an error:"runtime error 300. Arguments are of the wrong type,are out of acceptable range,or are in conflict with one another."

    Where am I going wrong?
    Last edited by loquin; 06-10-08 at 18:03.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    without knowing where the error is.. it does help if you highlight where the error was reported

    but Im guessing its trying to assign the value to the text control
    id be tempted to try...

    txtLocationName1.Text = "Name: " = dcoLocation1.SelectedItem

    Id also be tempted to ask VB questions in the VB section on this forum. If you have a pure VB problem, as opposed to a database problem with VB I'd be tempted to look at iNets sister site Xtreme Visual Basic
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    I'd be tempted to try

    txtLocationName1.Text = "Name: " & Loc1Name
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  4. #4
    Join Date
    May 2008
    Posts
    6
    Also see if all variables have been given the right Dim
    Per

Posting Permissions

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