Results 1 to 4 of 4

Thread: Help

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2004
    Posts
    235

    Help

    Private Sub Button1_ClickEvent_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.ClickEvent
    Dim cf2 As New CrossfireForm2

    If (DatePicker1.Value >= Now.AddDays(-1)) Then
    cf2.TextBox1.Text = DatePicker1.Value
    cf2.Refresh()
    cf2.Show()
    'Me.Hide()
    'End If
    ElseIf (DatePicker2.Value >= Now.AddDays(-1)) Then
    cf2.TextBox1.Text = DatePicker2.Value
    cf2.Refresh()
    cf2.Show()
    'Me.Hide()
    'End If
    ElseIf (DatePicker3.Value >= Now.AddDays(-1)) Then
    cf2.TextBox1.Text = DatePicker3.Value
    cf2.Refresh()
    cf2.Show()
    'Me.Hide()
    End If
    Me.Hide()
    End Sub


    I cant pass the DatePicker1,2,3.Value to cf2 which is form2's textbox

  2. #2
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949
    Hi,

    Make sure the cf2.Modifiers property is not set to Protected or Private in the design mode, and

    VB Code:
    1. cf2.TextBox1.Text = cstr(DatePicker3.Value)

    In VB.NET, the Text property Type of TextBoxes & similar is a String not a variant as in VB6.
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jul 2004
    Posts
    235
    I tried changing it as Public but still cant get the exact date.

    Private Sub Button1_ClickEvent_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.ClickEvent
    Dim cf2 As New CrossfireForm2
    If (DatePicker1.Value() >= DateTime.Today.ToString()) Then
    cf2.TextBox1.Text = CStr(DatePicker1.Value)
    cf2.Refresh()
    cf2.Show()
    'Me.Hide()
    'End If
    If (DatePicker1.Value >= DateTime.Today.ToString()) Then
    cf2.TextBox1.Text = CStr(DatePicker2.Value)
    cf2.Refresh()
    cf2.Show()
    ' 'Me.Hide()
    ' 'End If
    If (DatePicker1.Value >= DateTime.Today.ToString()) Then
    cf2.TextBox1.Text = CStr(DatePicker3.Value)
    cf2.Refresh()
    cf2.Show()
    ' 'Me.Hide()
    End If
    End If
    End If
    Me.Hide()
    End Sub

  4. #4
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949
    Hi,

    Are you sure that is your problem. I think you are not seeing cf2.

    Amend all your cf2.Show to cf2.ShowDialog.

    Also have you noticed that all three of your If clauses check the condition of DatePicker1?????

    The Me.Hide does not seem to work

    In

    If (DatePicker1.Value() >= DateTime.Today.ToString()) Then

    if you have Option Strict On then this will not compile. It should be

    If DatePicker1.Value() >= DateTime.Today Then
    Last edited by taxes; Jul 23rd, 2004 at 08:28 AM.
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

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