5 Replies - 219 Views - Last Post: 20 October 2019 - 02:07 AM Rate Topic: -----

#1 Chole-1997   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 19-October 19

information in the listbox frm aftermaking reservation in previous fr

Posted 19 October 2019 - 12:47 AM

Hi i would like to ask how to show information in the listbox in the form after making reservation in previous form?
Is This A Good Question/Topic? 0
  • +

Replies To: information in the listbox frm aftermaking reservation in previous fr

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15356
  • View blog
  • Posts: 61,571
  • Joined: 12-June 08

Re: information in the listbox frm aftermaking reservation in previous fr

Posted 19 October 2019 - 08:00 AM

Depends on a number of things.

Platform, how days is processed, what days is there, etc.
Was This Post Helpful? 0
  • +
  • -

#3 Chole-1997   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 19-October 19

Re: information in the listbox frm aftermaking reservation in previous fr

Posted 19 October 2019 - 10:42 PM

Like how?
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15356
  • View blog
  • Posts: 61,571
  • Joined: 12-June 08

Re: information in the listbox frm aftermaking reservation in previous fr

Posted 19 October 2019 - 11:03 PM

Again I would need more information.

Is this winforms, asp.net, some funky wpf, access form, etc?

What 'information'? What type? Quantity?
Was This Post Helpful? 0
  • +
  • -

#5 Chole-1997   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 19-October 19

Re: information in the listbox frm aftermaking reservation in previous fr

Posted 20 October 2019 - 12:04 AM

This the code of reservation form in visual basic.

Public Class frmReservation
    Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click

    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        frmBookingList.Show()
    End Sub

    Private Sub BtnCancel7_Click(sender As Object, e As EventArgs) Handles btnCancel7.Click
        frmMyAccount.Show()
        Me.Hide()
    End Sub

    Private Sub BtnConfirm_Click(sender As Object, e As EventArgs) Handles btnConfirm.Click
        Dim company As String
        Dim Reservation As String
        Dim Venue As String
        Dim StartDate As Date
        Dim EndDate As Date
        Dim StartTime As String
        Dim EndTime As String
        Dim ReservebyStaff As String

        company = txtCompany.Text
        Reservation = cmbRervationID.SelectedItem
        Venue = cmbVenueID.SelectedItem
        StartDate = dtpRSD.Value
        EndDate = dtpRED.Value
        StartTime = cmbST.SelectedItem
        EndTime = cmbET.SelectedItem
        ReservebyStaff = chkRbStaff.Checked
        'fill up the blanks
        If company = "" Or Reservation = "" Or Venue = "" Or StartTime = "" Or EndTime = "" Or ReservebyStaff = "" Then
            MsgBox("Please fill up the details.")
            ' if the venue is book on that day and time, please select another day, time and venue 
        Else
            MsgBox("Thank you for your reservation.")
            Me.Hide()
            frmShowVenue.Show()

        End If

    End Sub

    Private Sub FrmReservation_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub
End Class
:code:

And after fill up the reservation form, how to show the information to another form in the listbox?

This post has been edited by modi123_1: 20 October 2019 - 12:15 AM

Was This Post Helpful? 0
  • +
  • -

#6 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15356
  • View blog
  • Posts: 61,571
  • Joined: 12-June 08

Re: information in the listbox frm aftermaking reservation in previous fr

Posted 20 October 2019 - 02:07 AM

A few things come to mind.

First - treat form objects as just that, objects. You need to instantiate them to have coherent chance at data usage.

This is wrong.
11	        frmMyAccount.Show()


You would want to declare an instance of 'frmMyAccount' and then show that object.

Example:

Dim f2 As New Form2
f2.Show()


That way you can pass data to and from forms.

Ex:

        Dim f2 As New Form2
        f2.TextBox1.Text = "foo"
        f2.Show()


That is going to be the chief way to pass data to your listbox, or any control for that matter - create an instance of the form, interact with public properties and objects, and handle any return to the calling thread/form/method after it closes.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1