2,383 Posted Topics

Member Avatar for aianne

It because there is no SubItems(3) in your listview.. And why you show Owner ID twice in all of your codes? modified as following " [CODE]Set lst1 = lvStudentInfo.ListItems.Add With lst1 .Text = rs!Owner_ID .SubItems(1) = rs!Owner_Name .SubItems(2) = rs!Owner_Address End With[/CODE]

Member Avatar for aianne
0
2K
Member Avatar for sha1023012

Your code is fine. you just need to hide textboxes when form load. So, when your checkbox checked it will be visible : [CODE] private void Form1_Load(object sender, EventArgs e) { textBox4.Visible = false; textBox5.Visible = false; } private void checkBox1_CheckedChanged(object sender, EventArgs e) { if (checkBox1.Checked) { textBox$.Visible = …

Member Avatar for Jx_Man
0
152
Member Avatar for gozo12

An example : [CODE]Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick Dim i As Integer = DataGridView1.CurrentRow.Index With DataGridView1 If DataGridView1.Item(0, i).Value = "1" Then textbox1.text="hello" End If End With End Sub[/CODE]

Member Avatar for Jx_Man
0
123
Member Avatar for razamughal67
Member Avatar for Jx_Man
0
465
Member Avatar for RomeoX

[QUOTE][CODE]commandString = "Select * from tableadd where " + this.comboBox1.SelectedText + "like '%" + textBox1.Text + "%'" ;[/CODE] [/QUOTE] Your code should be correct. Try to add space before like statement. [CODE]commandString = "Select * from tableadd where " + this.comboBox1.SelectedText + " like '%" + textBox1.Text + "%'" ;[/CODE]

Member Avatar for dwarvenassassin
0
168
Member Avatar for razamughal67

See if this helps : API Declare : [CODE]Option Explicit Private Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long Private Type SHFILEOPSTRUCT hwnd As Long wFunc As Long pFrom As String pTo As String fFlags As Integer fAnyOperationsAborted As Long hNameMappings As Long lpszProgressTitle As Long …

Member Avatar for razamughal67
0
989
Member Avatar for moe0

[QUOTE]when the input is 12 years and 6 months I want the program to print teenager I'm not sure how to do that [/QUOTE] Input should be 12.6 to get right result. so you can concatenate textbox1 (for year) and textbox2 (for month) : [CODE]Private Sub Command1_Click() Select Case Val(Text1.Text) …

Member Avatar for skatamatic
0
304
Member Avatar for C0ding

I assume you use listbox for all controls : You can use '&' ampersand sign to concatenate all items with same index for every listbox. See this following code : [CODE]Private Sub Command1_Click() For i = 0 To List1.ListCount - 1 List4.AddItem List1.List(i) & List2.List(i) & List3.List(i) ' add items …

Member Avatar for C0ding
0
487
Member Avatar for c++ prog

add component for flash player : Right click on control toolbox->add/remove item->select the com component tab -> find add shockwave flash object. this control will show in my user control on control toolbox. to play add this code : [CODE] AxShockwaveFlash1.Stop() AxShockwaveFlash1.Movie = FilePath & "\FileName.swf" AxShockwaveFlash1.Play() [/CODE]

Member Avatar for donniedonos
0
236
Member Avatar for vanesh

[QUOTE]but when i'm trying to input grades for the other student i can't save the grade but there is no error shown[/QUOTE]. it cause you using "On Error Resume Next" statment on line 2. Delete this line and you will know what the error is if error detected.

Member Avatar for Jx_Man
0
124
Member Avatar for razamughal67

See if this helps : [CODE]Private Sub EnumFolders(fld As Object) Dim oShell As Object, fldItem As Object Dim i As Long On Error Resume Next Set oShell = CreateObject("Shell.Application") For Each fldItem In fld.Items If fldItem.IsFolder Then Call EnumFolders(fldItem) End If list1.AddItem fld.GetDetailsOf(fldItem, 0) Next Set fldItem = Nothing Set …

Member Avatar for Jx_Man
0
381
Member Avatar for tendaimare
Member Avatar for MaryApple
Member Avatar for razamughal67
Member Avatar for Cyre

You can use many ways here.. Here is an example : [CODE]Private Sub Save_Click() Set Conn = New ADODB.Connection Conn.Provider = "microsoft.jet.oledb.4.0" Conn.CursorLocation = adUseClient Conn.Open App.Path & "\Authors2.mdb" For i = 0 To List1.ListCount - 1 Set rs = Nothing Set rs = New ADODB.Recordset rs.Open "SELECT * from …

Member Avatar for Jx_Man
0
87
Member Avatar for SubProf
Member Avatar for belber

[URL="http://www.smsco.it/en/sms_tutorials/sms_from_vb6_visual_basic.jsp"]See This Tutorial[/URL]

Member Avatar for belber
0
226
Member Avatar for Shadizon
Member Avatar for ChrisPadgham
0
116
Member Avatar for LFCDay123

Use if-else statement : [CODE]If Option1.Value = True Then ' Your code if user select radio button 1 ElseIf Option2.Value = True Then ' Your code if user select radio button 2 End If[/CODE]

Member Avatar for Jx_Man
0
119
Member Avatar for Sturdy

See if this help. Add a timer, set interval to 1000 (or you can assign as you needed) And use this following code : [CODE]Private Sub Timer1_Timer() Label1.ForeColor = RGB(Rnd * 255, Rnd * 255, Rnd * 255) End Sub[/CODE]

Member Avatar for Sturdy
0
268
Member Avatar for markee

[QUOTE]I need help for my program.. I add a search the Adodc in my program with a combo box category, but when i run the program and search... the category "ID" not searching..[/QUOTE] You said that category ID is not searching. How about another category? If other category is successful …

Member Avatar for Jx_Man
0
326
Member Avatar for rapirap

Manipulate your sql query to receive input from textbox and put the code in textbox_change() event.. [CODE]Private Sub Text1_Change() ' your code here End Sub[/CODE]

Member Avatar for Jx_Man
0
287
Member Avatar for bantex07

[QUOTE]Please gave me some idea[/QUOTE] Use Sum function in your sql query. [QUOTE]or Code Thx [/QUOTE] modified as you needed : [CODE]Private Sub Command1_Click() Dim Conn As New ADODB.Connection Dim rs As New ADODB.Recordset Dim sConnect As String sConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "emp.mdb" 'Replace emp with your …

Member Avatar for Jx_Man
0
148
Member Avatar for cmcmurugan

in vb6 you can use Replace() function : [CODE]Replace(YourStringHere, " ", "")[/CODE]

Member Avatar for Jx_Man
0
69
Member Avatar for vishalchauhan

[URL="http://msdn.microsoft.com/en-us/library/system.datetime.compare.aspx"]Use DateTime.Compare(date1, date2) [/URL]

Member Avatar for Reverend Jim
0
303
Member Avatar for ynehs

Just trap the ascii code, So user only can input numbers. This following code just accept numbers input only : [CODE]Private Sub Text1_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 48 To 57, 8 '0-9 and backspace 'Let these key codes pass through Case Else 'All others get trapped KeyAscii = …

Member Avatar for Jx_Man
0
2K
Member Avatar for ng5

See this following code : [CODE]For i As Integer = 0 To ListBox1.SelectedIndices.Count - 1 ListBox1.Items.RemoveAt(ListBox1.SelectedIndex) Next[/CODE] Or you use this too : [CODE]Do While (ListBox1.SelectedItems.Count > 0) ListBox1.Items.Remove(ListBox1.SelectedItem) Loop[/CODE]

Member Avatar for ng5
0
176
Member Avatar for Jx_Man

This Code is easy way to load / show data in Datagrid. This Code write in vb.net 2003 and use sqlserver 2000 as database. I use module to connected VB.Net with SqlServer 2000. so the function to connected can be use in every form in this project.

Member Avatar for neronero
1
2K
Member Avatar for Sturdy

Try this : [CODE]Dim ctrAs Control For Each ctr In Me.Controls If TypeOf ctr Is TextBox Then If ctr.Text= vbNullString Then MsgBox "Textbox empty" ctr.SetFocus Exit Sub End If End If Next ctr[/CODE]

Member Avatar for Sturdy
0
475
Member Avatar for EkoX

See if this help : [CODE]Private Sub Command1_Click() List1.Clear x = 0 For j = 1 To Len(Trim(Text1.Text)) kt1 = Mid(Trim(Text1.Text), j, 1) kta = kta + kt1 If kt1 = Chr(32) Then x = x + 1 List1.AddItem Trim(kta) kta = "" End If Next j If x >= …

Member Avatar for EkoX
0
279
Member Avatar for marcmanlin2

>>what connection will i use and how and sample codes. You want to connect with access 2007 or you want to make report of your db? Anyway how far you doing this?

Member Avatar for marcmanlin2
0
591
Member Avatar for razamughal67

See if this helps : [CODE]Private Sub ListFiles(strPath As String, Optional Extention As String) 'Leave Extention blank for all files Dim File As String If Right$(strPath, 1) <> "\" Then strPath = strPath & "\" If Trim$(Extention) = "" Then Extention = "*.*" ElseIf Left$(Extention, 2) <> "*." Then Extention …

Member Avatar for razamughal67
0
5K
Member Avatar for belber
Member Avatar for razamughal67

See if this helps : [CODE]Public Function ChangeFileExt(ByVal aFilename As String, ByVal NewExt As String) As Boolean Dim p As Long Dim bp As Long Dim nFileName As String On Error Resume Next ChangeFileExt = False If aFilename = "" Then Exit Function p = 0 Do bp = p …

Member Avatar for razamughal67
0
1K
Member Avatar for LFCDay123

You can access form control using second form name as object. Put this code in any event you want : [CODE]Form2.Label1.Caption = Label1.Caption[/CODE]

Member Avatar for Jx_Man
0
118
Member Avatar for RASHIDDDDD
Member Avatar for ChrisPadgham
0
98
Member Avatar for november_pooh

Try this : [CODE]Private Sub Command1_Click() MsgBox Printer.DeviceName End Sub [/CODE]

Member Avatar for Jx_Man
0
89
Member Avatar for skyshare

As ChrisPadgham said..that is a simplest way. This following is other way (But Still needed to use Looping): [CODE]For Each controlx In Form1.Controls If TypeOf controlx Is TextBox Then controlx.BackColor = vbRed Next controlx[/CODE]

Member Avatar for skyshare
0
101
Member Avatar for stevo7624

>>If the optInst is selected at line 31 then chkMast or chkDoct needed to be weighted by 1.3. You mean if RB Instructor is selected then checkbox master and doctor should be checked? [CODE]Private Sub optInst_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles optInst.CheckedChanged lblSalOutput.Text = FormatCurrency(CInt(sumTotal())) If optInst.Checked …

Member Avatar for Jx_Man
0
151
Member Avatar for anammath

[QUOTE]would you help me, how to create table (ACCESS) with primary key in visual Basic 6? [/QUOTE] Well, your code is not completed since you never add all created columns to catalog(catDB) and also missing "End With" statement. To create PK you need to append a new key : I …

Member Avatar for Jx_Man
0
164
Member Avatar for belber
Member Avatar for Jx_Man
0
101
Member Avatar for belber
Member Avatar for EkoX
Member Avatar for EkoX
0
199
Member Avatar for tsik3x

First your database just contain user table only. I suggesting you to make complete your database. It useless when your database is not completed.

Member Avatar for Jx_Man
0
76
Member Avatar for dwiniers

Make sure that your table (login) is exists in your database and table name spell correctly.

Member Avatar for dwiniers
0
119
Member Avatar for razamughal67

See if this helps : Need 1 Module and 1 Button. In Module : [CODE]'Author : Gernan Mejia Aka DJ Unreal 303 'Language : VB5, VB6 'Operating Systems : Windows 9x, NT, 2000, Me, XP '------------------------------------------------------- Type PROCESSENTRY32 dwSize As Long cntUsage As Long th32ProcessID As Long th32DefaultHeapID As Long …

Member Avatar for Jx_Man
0
2K
Member Avatar for Sturdy

You can use [ICODE]Mid()[/ICODE], [ICODE]Left()[/ICODE] or [ICODE]Right()[/ICODE] function to get The first four characters and the last 3 characters and Use [ICODE]Len()[/ICODE] for the length of text.

Member Avatar for Sturdy
0
1K
Member Avatar for Sturdy
Member Avatar for Sturdy
0
4K
Member Avatar for aristosv

Try this [CODE]Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load For i As Integer = 1 To 5 CheckedListBox1.Items.Add(i) Next CheckedListBox1.CheckOnClick = True 'Checked item when you select it End Sub Private Sub CheckedListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckedListBox1.SelectedIndexChanged If CheckedListBox1.SelectedItem.ToString = …

Member Avatar for aristosv
0
655
Member Avatar for BasicBoy

>> All works very well, but I cannot restore the form. What you mean about cannot restore? I tried the code and it works great. I can restore it too. After minimize the form, left click the icon on system tray taskbar Or You can right click the icon and …

Member Avatar for BasicBoy
0
61

The End.