3 Replies - 1369 Views - Last Post: 22 December 2012 - 09:00 PM Rate Topic: -----

#1 bluemarine  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 19-December 12

Invalid procedure call or argument 'txtAmount.SetFocus'

Posted 19 December 2012 - 06:58 AM

im working on a school project, im creating a simple registration system, my instructor wants an interaction of two vb6 forms, so what i did is i search a member in formMember then lstMember,and in lstMember, doubleclick event, the member id and name will go to formTransaction(Payment something) and then setfocuses on txtamount.text, but it creates an error "Inalid Procedure call or argument" heres the code:


 Private Sub lstMember_DblClick()
    
    FormTransaction.lblMember.Caption = lstMember.ListItems(lstMember.SelectedItem.Index).Text
    FormTransaction.txtAmount.Enabled = True
    FormTransaction.txtAmount.SetFocus
    
    Unload Me
    
 End Sub




i just want it to focus on txtamount on FormTransaction after i double click the lstmember in FormMember.
hope someone can help me on this code, or any other ideas wud be ok...

sorry for the wrong spellings..

Is This A Good Question/Topic? 0
  • +

Replies To: Invalid procedure call or argument 'txtAmount.SetFocus'

#2 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 572
  • View blog
  • Posts: 2,985
  • Joined: 19-May 09

Re: Invalid procedure call or argument 'txtAmount.SetFocus'

Posted 19 December 2012 - 09:06 PM

It's because you haven't ever shown your form, so it hasn't been drawn yet. Add the command Form2.Show before your SetFocus, and you'll be fine.
Was This Post Helpful? 0
  • +
  • -

#3 bluemarine  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 19-December 12

Re: Invalid procedure call or argument 'txtAmount.SetFocus'

Posted 20 December 2012 - 08:41 AM

thanks bob i it works... :bigsmile:
Was This Post Helpful? 0
  • +
  • -

#4 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 572
  • View blog
  • Posts: 2,985
  • Joined: 19-May 09

Re: Invalid procedure call or argument 'txtAmount.SetFocus'

Posted 22 December 2012 - 09:00 PM

I tried it first to make sure. :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1