Jx_Man 987 Nearly a Senior Poster Featured Poster

Cassava chips with pocari sweat...

Jx_Man 987 Nearly a Senior Poster Featured Poster

1. Add new item on database
2. Load combobox item after add item.

just show us your effort :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

same as jbennet.

Jx_Man 987 Nearly a Senior Poster Featured Poster

open & close connection for every query.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi my name is Hussain Ahmed Chowdhury. I need your software & report. Please help me...
Here my id hacbd86@gmail.com

do it by yourself!!!

Jx_Man 987 Nearly a Senior Poster Featured Poster

you can use datediff() function to count days.

Jx_Man 987 Nearly a Senior Poster Featured Poster

HI...Welcome abroad friend :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Hi ajay...Welcome to Daniweb friend.
there are many members will need your help
You can contribute on java section

Jx_Man 987 Nearly a Senior Poster Featured Poster

HI krishniha...Welcome to daniweb friend :)
hope you will enjoy this site

Jx_Man 987 Nearly a Senior Poster Featured Poster

other suggestion use timer.
question for u :
why teme64 suggestion with sleep() function doesn't work for u? cause i think is better to use sleep than timer control.

Jx_Man 987 Nearly a Senior Poster Featured Poster

post your thread on Computer Science and Software Design section

Jx_Man 987 Nearly a Senior Poster Featured Poster

check the reference...

Jx_Man 987 Nearly a Senior Poster Featured Poster

You can post all function on your hotel management system. And we try to tell you what the function to add or dismiss.

Jx_Man 987 Nearly a Senior Poster Featured Poster

I was told u in previous post, I said the index of item means index of column on your table.but you can change with :
cmbAuthor.Items.Add(dtOle.Rows(i).Item("ColumnName"))

Jx_Man 987 Nearly a Senior Poster Featured Poster

none..

Jx_Man 987 Nearly a Senior Poster Featured Poster

Thanks for the links Teme64...

Jx_Man 987 Nearly a Senior Poster Featured Poster

You're Welcome :)

Neji commented: yes +2
Jx_Man 987 Nearly a Senior Poster Featured Poster

You're welcome
Don't forget to mark this thread as Solved :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

Ok. i understand it.
you mean why sohel in checkwinner got player name from sohel in global variable and why didn't get from other variable.

sohel in checkwinner get value when you called checkwinner and put which variable to used.
Ex :
there are 3 variable in global declaration

Dim ab as string
Dim sohel as string
Dim jewel as string

...
when u call checkwinner function you must fill parameter value.
say you want using ab as input value. then it become bellow code : Call CheckWinner(Text1, Text2, Text3, ab, jewel) so, ab will giving value and checkwinner get value from ab not sohel again.

Jx_Man 987 Nearly a Senior Poster Featured Poster

don't be confused. Just focus in the red line, that is how to get value from datetimepicker.
this is new example :

cmdTest.CommandText = "INSERT INTO Book(Id, Name, BirthDate) VALUES('" & Trim(txtId.Text) & "','" & Trim(txtName.Text) & "','" & dtBirthDate.Value.ToShortDateString & "')"
Jx_Man 987 Nearly a Senior Poster Featured Poster

what problem come up?any errors?

Jx_Man 987 Nearly a Senior Poster Featured Poster
Private Sub ReadData()
        Dim i As Integer

        con.ConnectionString = ("Provider = Microsoft.JET.OLEDB.4.0;Data Source= D:\Only Me\Authors.mdb")
        Try

            cmdOle = con.CreateCommand
            cmdOle.CommandText = "SELECT * FROM Authors "
            da.SelectCommand = cmdOle
            da.Fill(dsOle, "Authors")
            dtOle = dsOle.Tables("Authors")
            For i = 0 To dtOle.Rows.Count - 1
                cmbAuthor.Items.Add(dtOle.Rows(i).Item(1))
            Next

        Catch ex As Exception
            MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OKOnly, "Koneksi Error !!")
        End Try
        con.Close()
End Sub

in looping function ReadData will fill cmbAuthor with 2nd column from table author (.item(1), index start from 0). cmbAuthor.Items.Add(dtOle.Rows(i).Item(1))

Jx_Man 987 Nearly a Senior Poster Featured Poster

why you didn't use datagrid??

Jx_Man 987 Nearly a Senior Poster Featured Poster

sytnax for what???

Jx_Man 987 Nearly a Senior Poster Featured Poster

>> If I have other variable with (dim sohel as string) like dim ab as integer then the variable fox will work?
i didn't get what u mean.

what a function of variable ab?

Jx_Man 987 Nearly a Senior Poster Featured Poster

the red line is how to use datetimepicker :

cmdPendidikan1.CommandText = "INSERT INTO Pendidikan(IdPendidikan, Nis, Lulusan, LamaBelajar,SekolahAsal,Alasan,Kelas,Tgl) VALUES('" & Trim(IdPendidikan.Text) & "','" & Trim(cmbNis.SelectedItem) & "','" & Trim(txtLulusanDari.Text) & "','" & Trim(txtLamaBelajar.Text) & "','" & Trim(txtSekAsal.Text) & "','" & Trim(txtAlasan.Text) & "','" & Trim(cmbKelas.SelectedItem) & "','" & dtTglDiterima.Value.ToShortDateString & "')"
Jx_Man 987 Nearly a Senior Poster Featured Poster

post the code that you've done...

Jx_Man 987 Nearly a Senior Poster Featured Poster

show us your effort...
- draw image control and fill with the picture.
- draw a timer, set enable as true and interval as u needed (1000 for 1 second).
- make loop to move picture with left and top position.

Jx_Man 987 Nearly a Senior Poster Featured Poster

1. Yes, its for input name.
2. Yes, sohel used to know input name and show in msgbox. (same for jewel)
3. Yes, it connected.
First, sohel in CheckWinner function parameter and sohel in global declaration is different.
Sohel in checkwinner paramete got player name from sohel in global variable (from inputbox).
So you can change sohel paramete in checkwinner function with other name variable, its just a variable name. Same too for jewel.
Ex : sohel is fox and jewel is xof

Public Function CheckWinner(T1 As TextBox, T2 As TextBox, T3 As TextBox, fox As String, xof As String)
If (T1.BackColor = vbBlue) And (T2.BackColor = vbBlue) And (T3.BackColor = vbBlue) Then
    MsgBox "" & xof & "  win", vbOKOnly, "win"
    SetBackColor
End If
If (T1.BackColor = vbRed) And (T2.BackColor = vbRed) And (T3.BackColor = vbRed) Then
    MsgBox "" & fox & "  win", vbOKOnly, "win"
    SetBackColor
End If
End Function

But its still same when u call CheckWinner function (i mean the way to call).
Ex :

...
....
Call CheckWinner(Text1, Text2, Text3, sohel, jewel) ' sohel & jewel from global var
....
...

here, sohel and jewel from global variable for input name in the option button.

abu taher commented: thanks. I realy get a lot of help. +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

just rewrite it into vb6.
i believe if u can write program in vb.net than it would easy to convert it into vb6.

Jx_Man 987 Nearly a Senior Poster Featured Poster

That's your codes or get from internet?

Private file_count As Integer = 0
Public Sub GetDirectoryFileCount(ByVal dir As String)
  dir = dir & ”\”
  Dim all_files() As String=Directory.GetFileSystemEntries(dir)
  For Each file As String In all_files
    If Directory.Exists(file) Then
      GetDirectoryFileCount(file)
    Else
      file_count += 1
    End If
  Next file
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

oh...i'm sorry for that (missing it).
In general declaration, you declare sohel and jewel but one by one.

Dim sohel As String
Dim jewel As String

then in module, add parameter of CheckWinner()

Public Function CheckWinner(T1 As TextBox, T2 As TextBox, T3 As TextBox, sohel As String, jewel As String)
If (T1.BackColor = vbBlue) And (T2.BackColor = vbBlue) And (T3.BackColor = vbBlue) Then
    MsgBox "" & jewel & "  win", vbOKOnly, "win"
    SetBackColor
End If
If (T1.BackColor = vbRed) And (T2.BackColor = vbRed) And (T3.BackColor = vbRed) Then
    MsgBox "" & sohel & "  win", vbOKOnly, "win"
    SetBackColor
End If
End Function

So, when u call it at form you must to add 2 parameter again :
ex :

....
Call CheckWinner(Text1, Text2, Text3, sohel, jewel)
....

do it to all CheckWinner calling function.

Jx_Man 987 Nearly a Senior Poster Featured Poster

dickersonka is right...
Separated them into each procedure.

Jx_Man 987 Nearly a Senior Poster Featured Poster

I didn't understand clearly.

- U have 3 tables(cats,dogs,birds) or 4 tables(cats,dogs,birds and totalanimal) ?
- If u have 4 tables and want to get sum value of each column (cats,dogs,birds) and store into totalanimal column, then this not added column but update totalanimal column.

Jx_Man 987 Nearly a Senior Poster Featured Poster
Jx_Man 987 Nearly a Senior Poster Featured Poster

Yes, lizR right...
Make sure the table name is same (field, length and datatype too).
Read data from Access (using loop) then write certain data into MSSQL (this the logic, i never tried this).

Jx_Man 987 Nearly a Senior Poster Featured Poster

dim selectedItem as string
selectedItem = ComboBox.Text

why didn't use selectedItem = ComboBox.SelectedItem ?
and there are path on combobox item to loaded?

Jx_Man 987 Nearly a Senior Poster Featured Poster

why it didn't work?what error come up?
and it not variable but function. and it working for me when i post an attachment.

Jx_Man 987 Nearly a Senior Poster Featured Poster

maybe you clear textbox before added id into listbox.

Jx_Man 987 Nearly a Senior Poster Featured Poster
Jx_Man 987 Nearly a Senior Poster Featured Poster

Try This :
Declaration :

Option explicit

' Contrl variable
Private ctlName As Control

Code :

' This program demonstrates how you can add and delete
' controls on your form dynamically.


' Creates text box and label.
Private Sub cmdCreate_Click()
   ' Creates label.  controls.Add function takes three variables.
   ' first ("vb.label") accepts what type of control you want created,
   ' second ("lblLabel1") accepts the name of the control, the last
   ' one (frmControl) accepts where you want this control to be placed.
   Set ctlName = frmControl.Controls.Add("vb.label", "lblLabel1", frmControl)
   ' Make controls visible.  This step is required if you want the control
   ' to be visible.
   ctlName.Visible = True
   ' Move positions the control requires four arguments
   ' (left, top, width, height)
   ctlName.Move 500, 500, 1500, 250
   ctlName.Caption = "Label 1"
   Set ctlName = _
  frmControl.Controls.Add("vb.textbox", "txtTextBox", frmControl)
   ctlName.Visible = True
   ctlName.Move 2000, 500, 1500, 250

End Sub
' Quits the program.
Private Sub cmdExit_Click()
   End
End Sub

' Removes the controls created in the cmdCreate_Click()
' procedure.
Private Sub cmdRemove_Click()
   frmControl.Controls.Remove "txtTextBox"
   frmControl.Controls.Remove "lblLabel1"
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

- using TimeSerial() Function to get 2 hours before booking time.
see this line bTimeUp = TimeSerial(btimeA.Hour - 2, btimeA.Minute, btimeA.Second)

Dim bTimeA As DateTime
Dim bTimeUp As DateTime
btimeA = FormatDateTime(btime1.Value, DateFormat.LongTime)
bTimeUp = TimeSerial(btimeA.Hour - 2, btimeA.Minute, btimeA.Second) 
    If FormatDateTime(TimeOfDay, DateFormat.LongTime) = bTimeUp Then
        MsgBox("Booking Time up Mr/Miss " & Bcusname1.Text & " is late,reservation canceled")
        Table1.BackColor = Color.PaleGreen
        status1 = "Available"
    End If

- question for u : btime1 is datetimepicker or not?
if yes then set Format = Time on datepicker properties

Jx_Man 987 Nearly a Senior Poster Featured Poster

See this thread

Jx_Man 987 Nearly a Senior Poster Featured Poster

post your code that u have tried...

Jx_Man 987 Nearly a Senior Poster Featured Poster

- Maybe missing path of database
- you didn't include db file.

Just tell what kind of error when you running program on other machine.

Jx_Man 987 Nearly a Senior Poster Featured Poster

>> Call CheckWinner(Text1, Text2, Text3)
here text1 mean t1 what was write in the module?
Yes. text1 will assigned with T1, then T1 used to check back color of textbox.

>> Public Sub SetBackColor()
For Each controlx In Form1.Controls
If TypeOf controlx Is TextBox Then
controlx.BackColor = vbWhite
Next controlx
End Sub.
please explain under few lines. what is controlx?

Controlx is a Control (Form1.controls). It can be any controls (textbox, button,label, etc).
But in this function i check controlx as textbox.
See this line : If TypeOf controlx Is TextBox so i check on the form1, if i find text box control in form1 then back color of textbox become white. So you didn't have to spending times for writing code to change all textbox back color one by one, but you can do it with check control type. If control type is textbox then u can change any properties of text box (backcolor in this case).

You can change controlx type (ex. button) :

For Each controlx In Form1.Controls
If TypeOf controlx Is CommandButton Then
controlx.BackColor = vbWhite
Next controlx
End Sub

this code means for every controlx, if controlx is button then back color of button become white.

Sawamura commented: You work to hard for this :) +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

or hide login form (don't close it). so value of txtusername still exist.

Jx_Man 987 Nearly a Senior Poster Featured Poster

I already see your project.
You write too many if statement (make me dizzy) and it redundant.
Actually you can simplify your if statement become a function. so you just call function in each textbox checking.
I modified your program with added a module. In this module i put a function to check who is won and function to make all backcolor of textbox is white.

Module using to declare function/procedure or variable. with module you can call each function or variable from any form.

NB : you can make this program more simplify again. just see redundant if statement and exchange it become a function/procedure.

Jade_me commented: you make this program so simply.... +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

SELECT * FROM participants WHERE Date between DTPicker1.Value and DTPicker2.Value

abu taher commented: thanks a lot. +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Phone Book Application.