CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 1999
    Location
    London
    Posts
    10

    Creation of user controls

    We are creating a user control
    In general in every application we need to create an interface such as in one text box user will enter code such as customer code if he enters valid customer code then customer name should appear in another text box
    We also provide the command button to list the customer name incase user does not know the customer code

    Ultimate is not to allow the user to enter invalid customer code
    If enter the valid code then display respective name
    Provide a button by which he can get the help for list of customer

    Question :
    To select or validate the enter code we need to connect to database presently we are establishing new connection in control useing RDO
    If we wanted to pass a connection in to object as a property
    We got an error "Object veriable is not set "
    Please Suggest A way by which we can pass connection in to User control Or Dll
    Using property or any other way
    so that control can use the same connection establish by perent application





  2. #2
    Join Date
    Apr 1999
    Location
    Rotterdam, Netherlands
    Posts
    278

    Re: Creation of user controls

    Hi

    haven't testen it, but try something like
    usercontrol:
    Public Sub SetConnection(pConnection as rdoConnection)
    Set m_Connection = pConnection
    End Sub
    (don't forget to Set m_Connection = Nothing when you're done...)
    and call it simply like
    MyControl.SetConnection TheConnectionInTheForm

    Hope this works... :-)

    Crazy D :-)


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured