|
Vikrant Badhai wrote:
I am Developing a software using VB6.0 as Frontend and MSAccess as Backend.
why? VB6 is dead and no longer supported by Microsoft, and Access is better replaced by SQL Server 2005 Express. You really should update your skill set top more upto the moment tools and technology
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi!
My aim is to associate two checkboxes in different forms. For example lets say that Form2 has a checkbox and when I check it and close the form2, I want other checkbox to be checked in Form1.
I would like to know how it would be possible in runtime processing.
Thank You.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Assuming form2 is opened from form1
You will need form2 to have a reference to the open instance of form 1
This can be achieved by passing me to form2
dim oFrm as new Form2(me)
In the checkchanged event on form2 you can then manage the checkbox on form1
This can also be handled in the formclosing event.
The trick is to pass the form1 instance to form2
|
|
|
|
|
The best way to do this, is to set up delegates between the two forms. The nasty way, is to pass references to your forms about and make the checkboxes public.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian do you know of an article demonstrating the delegate operation - I'd be interested. While I don't recall ever actually doing this with 2 forms I had not pursued the delegate option.
TIA
|
|
|
|
|
|
Hi,
I have a datagrid and a checkbox template column is bounded to it on the 1st column. I want to check/uncheck all the checkboxes at once when user click the check/uncheck checkbox in the header template. I got the all the sample codes in Javascript and asp. But not for vb.net window application. Can anyone guide me the codes on window application? It would be grateful if you already have the reference and send it to me.
Thanks a lot for ur help.
|
|
|
|
|
I found this article here on Code Project.
http://www.codeproject.com/KB/grid/DataGridView_winforms.aspx[^]
I converted the below method for you, from C# to VB.NET. Just wire up this event handler and set the column index to match your data grid layout. The below code assumes that the CheckBox column is the first column, so if your is not, you'll need to make a few changes:
Just change the two following lines of code and replace the "0" with the correct column index.
If e.ColumnIndex = 0 Then
dataGridView1.Rows(i).Cells(0).Value = dgvColumnHeader.CheckAll
Private Sub dataGridView1_ColumnHeaderMouseClick(ByVal sender As Object, ByVal e As DataGridViewCellMouseEventArgs)
If e.ColumnIndex = 0 Then
For i As Integer = 0 To dataGridView1.Rows.Count - 1
dataGridView1.Rows(i).Cells(0).Value = dgvColumnHeader.CheckAll
Next
End If
End Sub
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Hi Karl,
Thanks for the sharing. But in window form it doesn't have DataGridViewCellMouseEventArgs.
What shall I change it to?
Appreciate your help again.
Thanks.
cheers,eunice
|
|
|
|
|
My bad. It's been a very long day.
It's the same event, ColumnHeaderMouseClick just different signature.
Private Sub myDataGrid_ColumnHeaderMouseClick(ByVal sender As Object, ByVal e As _
System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles myDataGrid.ColumnHeaderMouseClick
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Hi,
Can anybody please help me in getting a combobox in a particular column of datagrid. If possible please give me a code snippet.
Thanks,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
|
Hi
I have a project written in VB & I want to call a C++ code inside my project
How can I do that?
Or it is easier to change the second code to VB
Can anyone help me pls?
|
|
|
|
|
The only way to do that is if the C++ code was compiled into a .DLL library. You cannot directly call C++ code if all you have is the C++ source code.
|
|
|
|
|
OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus
Best wishes to Rexx[^]
|
|
|
|
|
www.wickedorange.com
www.andrewvos.com
|
|
|
|
|
I am trying to determine if a EmployeeNumb exits in the Access table below. The function I am using is outlined below, buy I get an exception error that there is not data in Row(0). can anyone help me out with identifying the problem? TIA
Sub TimeAlloc()
Dim strSelectNum As String
Dim sda As OleDb.OleDbDataAdapter
Dim dsEmployeeTime As DataSet
Dim cmdDatabase As OleDb.OleDbCommand
Dim conDatabase As OleDb.OleDbConnection
'need to determine if this is a new allcation WHERE EmployeeNumber exists in tblTimeAllocation
strSelectNum = _
"SELECT * FROM tblEmployeeAllocation WHERE EmployeeNumber = '" & _
txtEmployeeNumber.Text & "'"
' establish database connection
conDatabase = New OleDb.OleDbConnection( _
"Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=C:\devELOPMENT\WINTur\TurN.mdb")
cmdDatabase = New OleDb.OleDbCommand(strSelectNum, conDatabase)
dsEmployeeTime = New DataSet
sda = New OleDb.OleDbDataAdapter
sda.SelectCommand = cmdDatabase
sda.Fill(dsEmployeeTime)
'Try
Dim recEmployee As DataRow = dsEmployeeTime.Tables(0).Rows(0)
If recEmployee.IsNull("EmployeeNumber") Then
bNewTimeAllocation = True
Else
bNewTimeAllocation = False
End If
'Catch exc As IndexOutOfRangeException
' End Try
End Sub
ID EmpNumb TimeAllocationCode
1 88024 880242008020039
2 20410 204102008020039
3 25711 257112008020054
4 34873 348732008020015
5 200920 2009202008020041
6 91272 912722008020022
7 62062 620622008020050
8 63474 63474200802002
9 24277 242772008020026
12 771214 7712142008020040
13 773115 7731152008020030
14 200866 200866200802009
|
|
|
|
|
IvanIT wrote: strSelectNum = _
"SELECT * FROM tblEmployeeAllocation WHERE EmployeeNumber = '" & _
txtEmployeeNumber.Text & "'"
Your query didn't return any results. Probably because you're looking for a String, representing an EmpNumb, which might be a numeric value. A string containing a number is never going to be the same as the number itself.
Try changing the code above to read:
strSelectNum = "SELECT * FROM tblEmployeeAllocation WHERE EmployeeNumber = " & txtEmployeeNumber.Text
|
|
|
|
|
Dave,
Thanks for your input. I took your advice and I got a datatype mismatch error. This is stumping me because I have used this snip of code elsewhere before and it worked like a charm.
|
|
|
|
|
Well, without seeing the code and the line that the error occured on, it's pretty impossible to tell you what's going wrong.
|
|
|
|
|
hi man Vuyiswa here,
Do you want to Do Something like this ?
<br />
Public Sub TimeAlloc(ByVal strEmployeeNumber As String)<br />
<br />
Dim strSelectNum As String = "SELECT * FROM tblEmployeeAllocation WHERE EmployeeNumber = ?"<br />
<br />
Dim strcon As String = "Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=C:\devELOPMENT\WINTur\TurN.mdb"<br />
<br />
Dim sda As OleDbDataAdapter<br />
<br />
Dim dsEmployeeTime As New DataSet<br />
<br />
Dim cmdDatabase As OleDb.OleDbCommand<br />
<br />
Dim conDatabase As New OleDbConnection(strcon)<br />
<br />
cmdDatabase.Parameters.Add("EmployeeNumber", strEmployeeNumber)<br />
<br />
cmdDatabase.Connection = conDatabase<br />
<br />
sda.SelectCommand = cmdDatabase<br />
<br />
Dim bNewTimeAllocation As Boolean<br />
<br />
<br />
'need to determine if this is a new allcation WHERE EmployeeNumber exists in tblTimeAllocation<br />
'txtEmployeeNumber.Text'<br />
<br />
Try<br />
<br />
conDatabase.Open()<br />
<br />
<br />
sda.Fill(dsEmployeeTime, "tblEmployeeAllocation")<br />
<br />
If dsEmployeeTime.Tables("tblEmployeeAllocation").Rows.Count = 0 Then<br />
<br />
bNewTimeAllocation = True<br />
Else<br />
<br />
bNewTimeAllocation = False<br />
<br />
End If<br />
<br />
conDatabase.Close()<br />
<br />
Catch exc As OleDb.OleDbException<br />
<br />
MsgBox(exc.Message)<br />
End Try<br />
End Sub<br />
IvanIT Wrote|The function I am using is outlined below
This is not a Function is a Sub, a Function will return a Value,now i see you have Boolean Variables i suppose you want to return them? if so remove the Sub keyword and use Function and tell your function to return Boolean. lastly my question in the Following line
<br />
Dim recEmployee As DataRow = dsEmployeeTime.Tables(0).Rows(0)<br />
<br />
If recEmployee.IsNull("EmployeeNumber") Then<br />
<br />
What did you want to achieve here?
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
VBS for uninstalling symantec antivirus and liveupdate as well.
one click on the vbs will automatically uninstall the software above.
thanks.
|
|
|
|
|
The only place you're going to find a script like that is if you write it. We're not here to write your code for you. We'll help you with code you write though.
|
|
|
|
|
|
I beleive there is a tool for uninstalling symantec - I know it is a pig to get rid of.
A script to uninstall AV software, I don't think so .
|
|
|
|