Jx_Man 987 Nearly a Senior Poster Featured Poster

Great..Don't Forget to mark this thread as solved.

Jx_Man 987 Nearly a Senior Poster Featured Poster

if you follow my code correctly than all will running nice..

Jx_Man 987 Nearly a Senior Poster Featured Poster

what u men..do i need use select statment...

Yes.. before insert your data, you need to search the ID in database..
if Id exist in database then show an error message..

Jx_Man 987 Nearly a Senior Poster Featured Poster

Can we able to format BOLD and ITALIC to the same text?
Please reply ASAP.

How about make your own thread???

Jx_Man 987 Nearly a Senior Poster Featured Poster

transperncy form in mdi form is working to me..
put the same code in mdi form..

and for the manifest file..
if the manifest file is not working then your exe file cannot shown up..
if exe file appear then manifest file is working.

Jx_Man 987 Nearly a Senior Poster Featured Poster

what error said to you?

Jx_Man 987 Nearly a Senior Poster Featured Poster

i dont know how to use manifest file...i have code of manifest and i have made manifest file, but i dont know the way how to use that...can u plz tell me..
i have manifest file in c with this path and name" C:/vb6/vb6.exe.manifest"
will you please tell me the way how to use that with vb and controls.

Put manifest file on your project folder.
ex : your exe project name is EmployeeData.exe then rename manifest file into EmployeeData.exe.manifest then running EmployeeData.exe. you will see the changed.

and the code u have wrote above is not working on Midi Child Form....

use your midi formname instance of me..

Private Sub Form_Load()
  Transparant YourFormName.hwnd, Val(70), True ' 70%
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

what exactly you want to do?

Jx_Man 987 Nearly a Senior Poster Featured Poster

are you read my posts and any codes that i provides?

Jx_Man 987 Nearly a Senior Poster Featured Poster

yes,,you can make your all control seems like windows version..means in xp it looks in xp style or in win 7 its likes win 7..
just add manifest file on your project..

Jx_Man 987 Nearly a Senior Poster Featured Poster

just select id from database..if id key already saved in database then give an error message..

Jx_Man 987 Nearly a Senior Poster Featured Poster

See if this help :

Private Declare Function GetWindowLong Lib "user32.dll" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32.dll" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32.dll" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long

Private Const GWL_EXSTYLE As Long = -20
Private Const WS_EX_LAYERED As Long = &H80000
Private Const LWA_ALPHA As Long = &H2

Public Function Transparant(hwnd As Long, percent As Integer, pil As Boolean)
    Dim before As Long
    before = GetWindowLong(hwnd, GWL_EXSTYLE)
    If pil = True Then
        before = before Or WS_EX_LAYERED
        SetWindowLong hwnd, GWL_EXSTYLE, before
        SetLayeredWindowAttributes hwnd, 0, 255 * (percent / 100), LWA_ALPHA
    Else
        before = before And Not WS_EX_LAYERED
        SetWindowLong hwnd, GWL_EXSTYLE, before
    End If
End Function

Private Sub Form_Load()
Transparant Me.hwnd, Val(70), True  ' 70%
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

just insert your codes on button each event..
actually, post your code first.. so we can help you.

Jx_Man 987 Nearly a Senior Poster Featured Poster

The above all Suggestion are not working .
is here anyone who can solve this problem?

How About make your own thread and post your current code..
Don't rise old thread..

Jx_Man 987 Nearly a Senior Poster Featured Poster

The above all Suggestion are not working .
is here anyone who can solve this problem?

How About make your own thread and post your current code..
Don't rise old thread..

Jx_Man 987 Nearly a Senior Poster Featured Poster

you can use API files to do this.

Jx_Man 987 Nearly a Senior Poster Featured Poster

once one value has been selected, is there a way to disable it from being selected in the combo box or even delete the one value from the combobox but keep it in the database.

This following code to remove selected combo box item.

Private Sub Combo1_Click()
    Combo1.RemoveItem Combo1.ListIndex
End Sub
Jx_Man 987 Nearly a Senior Poster Featured Poster

transparency Window and all controls?

Jx_Man 987 Nearly a Senior Poster Featured Poster

what type of your field?

Jx_Man 987 Nearly a Senior Poster Featured Poster

arezz09, you already mark this thread as solved.
Would you like to share with us how you solve it ? So, when another member read your thread they will get the answer too.

Thanks.

codeorder commented: :) +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

you must put the code in the procedure, function or event.

Jx_Man 987 Nearly a Senior Poster Featured Poster

what the error says to you?

Jx_Man 987 Nearly a Senior Poster Featured Poster

You're Welcome...
Please Mark this thread as solved.
We've helps you several times but you never mark your thread as solved.
Mark thread as solved helping another member to learn from your threads.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Set KeyPreview on your form properties as True

Then Try this :

Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
    If e.KeyCode = Keys.F2 Then
	Button1.Enabled = False
    End If
End Sub
PdotWang commented: I also want to know how the F2 works. +1
Jx_Man 987 Nearly a Senior Poster Featured Poster

what you mean about not working?

Jx_Man 987 Nearly a Senior Poster Featured Poster

see if this help :

Declaration

Option Explicit

Private Declare Function GetSystemMenu Lib "user32" _
    (ByVal hwnd As Long, _
     ByVal bRevert As Long) As Long

Private Declare Function RemoveMenu Lib "user32" _
    (ByVal hMenu As Long, _
     ByVal nPosition As Long, _
     ByVal wFlags As Long) As Long
     
Private Const MF_BYPOSITION = &H400&

Function to disable

Public Function DisableCloseButton(frm As Form) As Boolean
    Dim lHndSysMenu As Long
    Dim lAns1 As Long, lAns2 As Long
   
    lHndSysMenu = GetSystemMenu(frm.hwnd, 0)
    lAns1 = RemoveMenu(lHndSysMenu, 6, MF_BYPOSITION)
    lAns2 = RemoveMenu(lHndSysMenu, 5, MF_BYPOSITION)
    DisableCloseButton = (lAns1 <> 0 And lAns2 <> 0)
End Function

Call When form load

Private Sub Form_Load()
Call DisableCloseButton(Me)
End Sub

If your question already answered then please mark thread as solved.
Mark thread as solved really helping another member when they read your thread too (no doubt for them to learn from your thread).

debasisdas commented: really great answer, as always. +8
Estella commented: owesome :) +4
Jx_Man 987 Nearly a Senior Poster Featured Poster

j on first page is for adding text boxes during run time. and on the second page, he tried to get value from textboxes while the textboxes adding on the form.
If we try to get textbox value while textbox created then we never get user input.
On page two he said to get user input and when he press a button then he will get textbox value.
If he put the code on the button event then where is j come from? ;)

Jx_Man 987 Nearly a Senior Poster Featured Poster

i'm not try to remember all of it..just try to understand how to use it and do a lot of practice.
ex : delete query is from sql language. there are single quote in the statment.
delete from login where login_id = '1' , when you use it on vb you will know that delete statment still need single quote. that i mean about understanding.
if you understand automatically you'll remember it :)

Happy coding and don't forget to mark this thread as solved.

Jx_Man 987 Nearly a Senior Poster Featured Poster

ctr is a user input.. txt(j).Text , what is j ?? j is not using in your looping. so it will give u an error.
if you want to use j then your code should be like this :

Dim j as Integer
For j = 0 To ctr - 1
    a = txt(j).Text   
Next j

but if you want to use ctr in your looping then your code should be like this :

For ctr = 0 To ctr - 1
    a = txt(ctr).Text  ' j changed with ctr
Next ctr
Jx_Man 987 Nearly a Senior Poster Featured Poster

See if this help :

SaveSetting "AddressBook", "Login\Data", "Username", Trim(txtUserName.Text)
ITKnight commented: Thank you.. :) +4
Jx_Man 987 Nearly a Senior Poster Featured Poster

Try this following code to refresh datagrid :

Private Sub Refresh_DataGrid()
        Dim conn As SqlConnection
        Dim cmdTest As New SqlCommand
        Dim daTest As New SqlDataAdapter
        Dim dsTest As New DataSet
        Dim dtTest As New DataTable

        conn = GetConnect()
        Try
            cmdTest = conn.CreateCommand
            cmdTest.CommandText = "SELECT * FROM Meeting"
            daTest.SelectCommand = cmdTest
            daTest.Fill(dsTest, "Meeting")
            DataGridView1.DataSource = dsTest
            DataGridView1.DataMember = "Meeting"
            DataGridView1.ReadOnly = True
        Catch ex As Exception
            MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OKOnly, "Connection Error !!")
        End Try
    End Sub

You can call this procedure after update :

Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
Dim fieldName1 As String = txtMeetingSubject.Text
...
...
UpdateMyData(ConnString, fieldName1, fieldName2, fieldName3, fieldName4, fieldName5, fieldName6, fieldName7, fieldName8, fieldName9)

' Call Refresh_DataGrid Procedure
Refresh_DataGrid
End Sub

Also you can use this procedure to refresh datagrid after add or delete data..

Jx_Man 987 Nearly a Senior Poster Featured Poster

just write the code to display data into datagrid and call it after update data..

Jx_Man 987 Nearly a Senior Poster Featured Poster

missing single quote :

Dim cmd2 As New OleDb.OleDbCommand("DELETE FROM tblPNGATSAExecutive WHERE ExecutiveID = '" & lvData.Items(ItemNo).SubItems(0).Text & "'", conn)
Jx_Man 987 Nearly a Senior Poster Featured Poster

Dim myInsertQuery As String = "Update Meeting Set Meeting_Date = "", StartTime_Planned = "", EndTime_Planned = "", StartTime_Actual = "", EndTime_Actual = "", ChairedBy = "", Department = "" , Logged_By = "" Where ( Meeting_Subject = '" + Meeting_Subject + "' )"

your sql statment is wrong. your query is missing single quote and ampersand sign, and you didn't assign any fieldname with any parameter.
I confused to recognize what is your fieldname and what is your paramater name.
Your code should like this :

Dim myInsertQuery As String = "Update Meeting Set Meeting_Date = '" & Meeting_Date  & "', StartTime_Planned = '" & StartTime_Planned &"', EndTime_Planned = '" & EndTime_Planned &"', StartTime_Actual = '" & StartTime_Actual &"', EndTime_Actual = '" & EndTime_Actual &"', ChairedBy = '" & ChairedBy  &"', Department = '" & Department  &"' , Logged_By = '" & Logged_By &"' Where ( Meeting_Subject = '" & Meeting_Subject & "' )"

if you want to get value direct from text boxes then your code should be like this following example:

"UPDATE Users SET Id_User='" & Trim(txtUserId.Text) & "', Id_Role= '" & Trim(txtIdRole.Text) & "' , Password='" & Trim(txtPasw.Text) & "' WHERE Id_User='" & Trim(txtUserId.Text) & "'"

You should to execute your query :

myCommand.ExecuteNonQuery()
Jx_Man 987 Nearly a Senior Poster Featured Poster

are you really don't know how to do it?

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim msg As MsgBoxResult
        If MsgBox("Do you really want to exit ?", MsgBoxStyle.YesNo, "Exit") = msg.Yes Then
            Me.Close()
        End If
    End Sub
debasisdas commented: agreed +8
Vega_Knight commented: see.. +4
Jx_Man 987 Nearly a Senior Poster Featured Poster

code in debasisdas link is for vb2005 but SaveSetting have same way to use in vb6.
there are sample code too in debasisdas link.

See if this help :

' Save form settings

Function SaveFormSettings(ByVal AppName As String, frm As Object)
    SaveSetting AppName, frm.Name, "Left", frm.Left
    SaveSetting AppName, frm.Name, "Top", frm.Top
    SaveSetting AppName, frm.Name, "Width", frm.Width
    SaveSetting AppName, frm.Name, "Height", frm.Height
    SaveSetting AppName, frm.Name, "WindowState", frm.WindowState
End Function

' Restore form settings.

Function LoadFormSettings(ByVal AppName As String, frm As Object)
    Dim currWindowState As Integer

    ' in case no value is in the registry
    On Error Resume Next

    ' If the form is currently maximized or minimized, temporarily
    ' revert to normal state, otherwise the Move command fails.
    currWindowState = frm.WindowState
    If currWindowState <> 0 Then frm.WindowState = 0
    
    ' Use a Move method to avoid multiple Resize and Paint events.
    frm.Move GetSetting(AppName, frm.Name, "Left", frm.Left), _
        GetSetting(AppName, frm.Name, "Top", frm.Top), GetSetting(AppName, _
        frm.Name, "Width", frm.Width), GetSetting(AppName, frm.Name, "Height", _
        frm.Height)
    frm.WindowState = GetSetting(AppName, frm.Name, "WindowState", _
        currWindowState)
End Function

' Delete form settings

Sub DeleteFormSettings(ByVal AppName As String, frm As Object)
    DeleteSetting AppName, frm.name
End Sub

Using these routines is straightforward:


Private Sub Form_Load()
    LoadFormSettings "MyApp", Me
End Sub

Private Sub Form_Unload(Cancel As Integer)
    SaveFormSettings "MyApp", Me
End Sub
ITKnight commented: Thanks for completed answer +4
Jx_Man 987 Nearly a Senior Poster Featured Poster

You can use SaveSetting()

Jx_Man 987 Nearly a Senior Poster Featured Poster

post your code and we try to fix it :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

See if this help :

Arr1 = Split("aaa bbb&ccc ddd&eee","&")
ITKnight commented: Thanks +4
Jx_Man 987 Nearly a Senior Poster Featured Poster

@ Andre : thanks for the correction about listbox (you right index in lisbox start with 0) but i'm not sure about listview. if you minus listitems.count with 1 then it will skip the last item when you adding the items.

Jx_Man 987 Nearly a Senior Poster Featured Poster

Can anyone help me show how to upload file into database which is ms access. The file can be document,picture or video..Anyone???

show your effort first. so other members can help you.

Jx_Man 987 Nearly a Senior Poster Featured Poster

You're Welcome.. :)
Don't forget to mark this thread as solved.

Happy Coding.

Jx_Man 987 Nearly a Senior Poster Featured Poster

use blob. save into binary file.
see this link
why you not save the path and play it?
its much easier.

Jx_Man 987 Nearly a Senior Poster Featured Poster

post your last code and what the error tell to you?

Jx_Man 987 Nearly a Senior Poster Featured Poster

don't forget to mark this thread as solved :)

Jx_Man 987 Nearly a Senior Poster Featured Poster

is this is possible to plus all that items(Integer) that are in listbox or listview...

Yes, you can.

For listbox :

Dim i, result As Integer
For i = 0 To List1.ListCount
    result = result + List1.List(i)
Next i
MsgBox result

For Listview :

Dim i, result As Integer
For i = 1 To ListView2.ListItems.Count
    result = result + ListView2.ListItems(i).SubItems(1)
Next i
MsgBox result
Jx_Man 987 Nearly a Senior Poster Featured Poster

THANKS JX...ITS WORKING VERY WELL, BUT STILL IT IS ERRORING,WHEN THERE IN NO ANY RECORD IN LISTVIEW..

"Object Variable or with block variable not set."

Just check the items, if there are no data in listview then display a message.

If ListView2.ListItems.Count > 0 Then
    If CheckId(ListView2.SelectedItem) = True Then
        SQlQuery = "DELETE FROM Users WHERE Id_User ='" & Trim(ListView2.SelectedItem) & "'"
        Conn.Execute SQlQuery, , adCmdText
    Else
        MsgBox "Record not find"
    End If
Else
    MsgBox "no data on list view"
End If

where='" & Trim(Id)" what is it's functionalty

Trim used to remove white space at the beginning and end of a string.
Ex : Trim(" Daniweb ") -> Result : "Daniweb"

Jx_Man 987 Nearly a Senior Poster Featured Poster

no i have used only one, i have changed the concept..now when user will add new records, the listview will b clear, and new records will b added to list and when user will update that records, list will b refreshed and it will show old and new both records now, if anyone wants to change anything, then i have kept the button of delete, he can delete any previous or new record...

i think its a better option...what do u say?

Yes.. Its a better option.. Nice idea :)

Jx_Man 987 Nearly a Senior Poster Featured Poster
Do Until rs.EOF = True
    Combo1.AddItem rs!CustomerFirstName
    rs.MoveNext
Loop
debasisdas commented: agree +8
Jx_Man 987 Nearly a Senior Poster Featured Poster

how about two listview.
one for input data (added data to listview then add it), one for displaying data.