Jx_Man 987 Nearly a Senior Poster Featured Poster

Post your code. how far you doing this.

Jx_Man 987 Nearly a Senior Poster Featured Poster

but i am getting error hey please explain me through the code please

Open the link that i provide to you. You will get codes there.
Or you can use codeorder n waqasaslammmeo to use WMP component.

Jx_Man 987 Nearly a Senior Poster Featured Poster

i want to pass a text from a textbox in form1 to a label in form2

This following code will transfer text in textbox in form1 to label in form2.

Private Sub Form_Load()
Label1.Caption = Form1.Text1.Text
End Sub

but the text in form1 is retrieved from a database.

Different question. so you need to make new thread.

Jx_Man 987 Nearly a Senior Poster Featured Poster
codeorder commented: .cool.link.:) +12
Jx_Man 987 Nearly a Senior Poster Featured Poster

You have 'typ' attribute. you can use it :

If ((resp = "y") Or (resp = "Y")) Then
    prequa = PrimePrice
    typ = "Premium"
Else
    prequa = RegularPrice
    typ = "Regular"
End If

Then change this line :

Console.WriteLine(vbLf & "Quality : " & typ)

Also : Private prequa As String it should be : Private prequa As Double total = quan * prequa --> You can't multiply Double with String. it must same type.

EkoX commented: Great +1
Jade_me commented: Great +2
Jx_Man 987 Nearly a Senior Poster Featured Poster

I try changing it prequa = True to prequa = 13.08 but it didn't work so what can you do?

You can't. prequa type is Boolean (True or False). Prequa can't accept another value except true or false.
Make new variable as a Double or change the type of prequa from Boolean to Double.

Sawamura commented: Helpfull as always.. +3
Jx_Man 987 Nearly a Senior Poster Featured Poster

thx it was only that easy

So it's already solved?

Jx_Man 987 Nearly a Senior Poster Featured Poster

Okay. Line 21 : Console.Write(name("Do you want premium y/n")) It should be Console.Write(name + " Do you want premium y/n")

Jx_Man 987 Nearly a Senior Poster Featured Poster

Error occur in which line?

Jx_Man 987 Nearly a Senior Poster Featured Poster

any1 wit answer????

Did you read my post?

Jx_Man 987 Nearly a Senior Poster Featured Poster

You wrong when put commas n single quotes. did u see my post?

Jx_Man 987 Nearly a Senior Poster Featured Poster

You changed your question...
See if this helps :

Public Function fact(a As Integer)
Dim i As Integer
Dim f As Integer
f = a
For i = a - 1 To 2 Step -1
f = f * i
Next
fact = f
End Function
'------------------------------------

Private Sub Command2_Click()
Dim a As Integer
a = InputBox("put values")
Print "factorial =" & fact(a)
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

Any error appear?

Jx_Man 987 Nearly a Senior Poster Featured Poster

Don't Use AND

Query = "INSERT INTO PROD_DB_Complete_Board (ID, [Board Size], Laminate, [Stock Level]) Values('" & TextBox4.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox1.Text & "')"
Jx_Man 987 Nearly a Senior Poster Featured Poster

Dear brothers,

I also want to ask you guys about my problems. I have this VB6 application which uses Ms Access 2003 as a back-end. It was working well on WinXP platform. I want to install the application on a Win7 machine and i am having error on connection string. I have checked on various websites if i can find some help, but with no luck. What must i do to install this application on Win7? Is there any change that i must do on my codding? or do i need any third party? Your quick help will be much appreciated.

Thank you

How about make your own thread brother...
Don't rise dead thread (its a rule). Just make a new one.

Jx_Man 987 Nearly a Senior Poster Featured Poster
Query = "update Prod_DB_Completed_Board set [Stock Level] = '" & TextBox2.Text & "' where Laminate = '" & ComboBox2.Text & "'" & "AND" & "'" ComboBox3.Text & "'"

Missing Other Column Name :

"AND OtherColumName = " & "'" ComboBox3.Text & "'"
Jx_Man 987 Nearly a Senior Poster Featured Poster

Seems He/she already solved it,a few minutes after this thread posted:)

Vega_Knight commented: :p +2
Jx_Man 987 Nearly a Senior Poster Featured Poster

>> Is it possible to have the menu and header static and loads each form in one dynamic container.
Yes. You can make parent-child form.
Say Form1 as the container/parent and form2 as child.
Set IsMdiContainer in Form1 Properties as True.
In menu event :

Dim a As New Form2
 a.MdiParent = Me
 a.Show()
Hawk123 commented: cool +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

Yes. Good Job..
I not have compiler installed right now. so i forgot that windows cannot save symbols like "/" as an address.
Don't forget to mark this thread as solved.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Try this :

SaveFileDialog1.FileName = Date.Now
Jx_Man 987 Nearly a Senior Poster Featured Poster

Or you can check the length of filename.

If OpenFileDialog1.FileName.Length > 0 Then
    Dim loader As New IO.StreamReader(OpenFileDialog1.FileName)
    TextBox1.Text = loader.ReadLine
    TextBox2.Text = loader.ReadLine
    ...
    loader.Close()
End If
Jx_Man 987 Nearly a Senior Poster Featured Poster

The best? PHP i think (for me).
You also can use framework like CodeIgniter, CakePHP, etc to develop your website.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Why you not merge it as one sql query?

strsql = "select * from student_info where Surname, First_Name, Middle_Name not in " _
		& "(select Surname, First_Name, Middle_Name from accounting_system)"
MsgBox("student")
Jx_Man 987 Nearly a Senior Poster Featured Poster

Just do both of them at the same time.
In any event of control you can add item to listbox or combobox and add it to database.
Same action for edit, delete and transfer.
E.g :

Private Sub Command1_Click()
     List1.AddItem Text1.Text
     'your codes to add item to database 
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

Well, i don't really know what you mean about 'empty'.
Maybe this article can help

Jx_Man 987 Nearly a Senior Poster Featured Poster

See if this helps :

Dim StartPos, Counter As Integer
    Dim FindString, ReplaceText As String
    FindString = "test"
    ReplaceText = "MyString"
     
    For Counter = 1 To Len(Text1.Text)
            StartPos = InStr(Text1.Text, FindString)
            If StartPos > 0 Then
                    Text1.SelStart = StartPos - 1
                    Text1.SelLength = Len(FindString)
                    Text1.SelText = "" + ReplaceText
            End If
    Next
november_pooh commented: Yes. This code very helpful. +3
Jx_Man 987 Nearly a Senior Poster Featured Poster

You're Welcome

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

You can use SysInfo Component to get information about battery status.
Project->Component->Microsoft SysInfo Control
Add it to Form and use this following codes :

Private Sub Form_Load()
    List1.AddItem "BatteryFullTime = " & _
    Format$(SysInfo1.BatteryFullTime)
    List1.AddItem "BatteryLifeTime = " & _
    Format$(SysInfo1.BatteryLifeTime)
    List1.AddItem "BatteryLifePercent = " & _
    Format$(SysInfo1.BatteryLifePercent / 100, _
    "Percent")
    Select Case SysInfo1.BatteryStatus
    Case 1
    List1.AddItem "BatteryStatus = HIGH"
    Case 2
    List1.AddItem "BatteryStatus = LOW"
    Case 4
    List1.AddItem "BatteryStatus = CRITICAL"
    Case 128
    List1.AddItem "BatteryStatus = NO BATTERY"
    Case 255
    List1.AddItem "BatteryStatus = UNKNOWN"
    End Select
End Sub
debasisdas commented: really appreceate that. +13
Sawamura commented: Thank you sir. This code working so well. I really appreciated this +3
Estella commented: I appreciated it too :) +3
Jx_Man 987 Nearly a Senior Poster Featured Poster

You're Welcome. :)

Vega_Knight commented: Very helpful person +2
Jx_Man 987 Nearly a Senior Poster Featured Poster

See if this helps :

Option Explicit

#If Win32 Then
    Private Const LB_FINDSTRING = &H18F
    Private Declare Function SendMessage Lib _
                    "User32" Alias "SendMessageA" (ByVal _
                    hWnd As Long, ByVal wMsg As Long, _
                    ByVal wParam As Long, lParam As Any) _
                    As Long

#Else

    Private Const WM_USER = &H400
    Private Const LB_FINDSTRING = (WM_USER + 16)
    Private Declare Function SendMessage Lib _
                    "User" (ByVal hWnd As Integer, ByVal _
                    wMsg As Integer, ByVal wParam As _
                    Integer, lParam As Any) As Long
#End If

Private Sub Form_Load()
    List1.AddItem "Orange"
    List1.AddItem "Banana"
    List1.AddItem "Apple"
    List1.AddItem "Pear"
End Sub

Private Sub Text1_Change()
    Dim pos As Long
    List1.ListIndex = SendMessage(List1.hWnd, LB_FINDSTRING, -1, ByVal CStr(Text1.Text))

    If List1.ListIndex = -1 Then
        pos = Text1.SelStart
    Else
        pos = Text1.SelStart
        Text1.Text = List1
        Text1.SelStart = pos
        Text1.SelLength = Len(Text1.Text) - pos
    End If

End Sub

Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
    On Error Resume Next
    If KeyCode = 8 Then 'Backspace
        If Text1.SelLength <> 0 Then
            Text1.Text = Mid$(Text1, 1, Text1.SelStart - 1)
            KeyCode = 0
        End If
    ElseIf KeyCode = 46 Then 'Del
        If Text1.SelLength <> 0 And _
            Text1.SelStart <> 0 Then
            Text1.Text = ""
            KeyCode = 0
        End If
    End If
End Sub
ITKnight commented: Thank you Jx_man for wonderful codes +2
makiprabakaran commented: sir onr dought me. when i wrongly selected do backspace bar buuton tottaly erase.i want erase one by one backspace +0
Jx_Man 987 Nearly a Senior Poster Featured Poster

hi friend how about using the listview in vb6! thank you

How about make your own thread?

Jx_Man 987 Nearly a Senior Poster Featured Poster

did you already convert it to date format?

FormatDateTime(tanggalbaliktxt.Text, DateFormat.ShortDate)
Jx_Man 987 Nearly a Senior Poster Featured Poster

I suggest to trap it when user input the characters.
So, users can only input the specific characters.
Example : (This text box only accept numbers input only)

Private Sub TextBox2_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress
    If Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57 Then
        e.Handled = True
    End 
    If Asc(e.KeyChar) = 8 Then
        e.Handled = False
    End If
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

See this "tanggalpinjam.Text and tanggalbaliktxt.Text"
I think this the problem. You want to insert a date of borrowed date n returning date but you insert it as text.
Just convert it to date format. Make sure the type of both column is date in your database not text or numeric.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Actually this section for VB 4/5/6, and your code is for VB.Net Section.
For your question.
I suggest to trap any character except "abcdefg" and "12345" when user type it on textbox. So user only can input "abcdefg" or "12345".

Jx_Man 987 Nearly a Senior Poster Featured Poster

Each time I enter the text in the box after clicking the (Add button), it does not add it in the combobox. What's missing??

You code never add text to combo box.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim userMsg As String
        userMsg = Microsoft.VisualBasic.InputBox("Enter New City", "New City", "", 500, 500)
        ComboBox1.Items.Add(userMsg)
    End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster
Jx_Man 987 Nearly a Senior Poster Featured Poster

Provides more information.
Actually, how far you doing this.
Post your code and we try to correct it.

Jx_Man 987 Nearly a Senior Poster Featured Poster

NO. I don't want to know about your purpose.
How far you coded this thing (capture display)??
Make some effort.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Just use looping.
If you already manage to move single item, then use looping to move all items.

Jx_Man 987 Nearly a Senior Poster Featured Poster

how far you doing this?

Jx_Man 987 Nearly a Senior Poster Featured Poster

post your code..

Jx_Man 987 Nearly a Senior Poster Featured Poster

I don't understand what the relevance about your question and your posting code, but i still to answer it.

If you want to close all form and end the program then you can use END .
Unload Me just close the current form not the entire program. So any hidden form can still running.

Private Sub Command1_Click()
Unload Me
End Sub

When you use End Statement it will close all entire form, Hidden or not hidden. so any process will turning off.

Private Sub Command2_Click()
End
End Sub
Sawamura commented: I think.. +3
Jx_Man 987 Nearly a Senior Poster Featured Poster

Sometimes upgrade wizard is not working. So, just rewrite the codes in vb.net :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

I always receive Run-time error '70' "Permission denied"

Your database currently used. Close All connection before copying it.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Your code is running good but you need to specify the select statement query.
You cannot select entire data and compare it on select-case, select-case will get wrong input. So you need to specify data from db.
I don't know what the fields on your User_Tab Table but i try to give an example.
With this query, select-case will get right input :

'Specify your query to get right data
Set Type_rs = db.OpenRecordset("SELECT * FROM User_Tab Where UserName = 'Admin' And Password = 'admin'")
Jx_Man 987 Nearly a Senior Poster Featured Poster

What the function of Str_T?

Also your select case is wrong. Just fill Type_rs with user type information from db (With Type_rs.Open ...) .

SELECT Case Type_rs.Field("User Type")
Case "Administrator"
    mainfrm.toobar1.enable=true
case "Operator"
    mainfrm.toolbar1.enable=False
End SELECT
Jx_Man 987 Nearly a Senior Poster Featured Poster

Make sure that you've been declared adoTransaction :

Set adoTransaction = New ADODB.Recordset
Jx_Man 987 Nearly a Senior Poster Featured Poster

and when customer insert the notes into machine, the textbox appear the number of notes.

Insert the notes from where? textbox? or other control?
What the buttons function? you want when the user click the button the textbox show the result of balance? what the itotal function?

Jx_Man 987 Nearly a Senior Poster Featured Poster

Show your effort friend. post your code that you've been work. :)