|
Thanks.... I think :P
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian Graus wrote: Someone shoot me.....
I've got this supa-soaka thing. Will that do?
|
|
|
|
|
I,m Thailand.I study in Univerisy 4th but I have project about Visual Studio 2005.
I progamming by Visual basic 2005.I Want Create form login and connect to SQL2000.
And pass another form.
This time,I design form complete.I want source code to connect SQL2000.
Requirment
- log in pass another form
- check user and passwaord
- create function checkform
please help me!
Email:sniper465101@yahoo.com
|
|
|
|
|
I'm sorry, if you're incapable of finding this on the web using Google, then you should reconsider your career. The web abounds with this stuff.
And no-one is going to write a project and email it to you. If you can't read the site, why would people on the site help you at all ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I was trying to have bill which contain item inside each bill. Example the bill no is 1. it compare the bill no. first then the item no, since customer might buy more then 1 item. But when i run the function my system hang... wat happen??
Do
On Error Resume Next
If rr![NO] = ldono.Caption Then
If rr![item] = item.Caption Then
temp = rr![item]
rr.MoveNext
End If
End If
Loop Until (rr.EOF)
item.Caption = Val(temp) + 1
Here is the code that work properly but when i try to enter item on my second bill the number will continue from the bill no1.
like in bill no1. item 1,2,3
and bill no2, item 4,5,6 - which i want to make it as 1,2,3 and dont want to be related to the bill no1.
Do
On Error Resume Next
If rr![NO] = ldono.Caption Then
temp = rr![item]
rr.MoveNext
End If
Loop Until (rr.EOF)
item.Caption = Val(temp) + 1
I hope someone can understand my problem....-.-"
|
|
|
|
|
campbells wrote: On Error Resume Next
This is why VB sucks
campbells wrote: Do
On Error Resume Next
If rr![NO] = ldono.Caption Then
If rr![item] = item.Caption Then
temp = rr![item]
rr.MoveNext
End If
End If
Loop Until (rr.EOF)
Two conditions need to be met on every iteration, otherwise your code will just get stuck until the end of time, I see no code to guarentee that you'll keep moving through the DB until the end, every time.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
ok i think i have solve the error, but i didnt get the result i want ...
any suggestion?? i have an idea is it possible to use SQL?? but i not sure how to edit it with my code...
cause seem like the computer didnt refer the bill no to increase the item number properly.
My idea was:
temp = rr![item] where dono.Text = rr![NO] (where i think this may specific the location which data to refer..)
Anyone can help me modify my logic to proper coding???
Orginal coding:
If dono.Text = rr![NO] Then
Do
temp = rr![item]
rr.MoveNext
Loop Until (rr.EOF)
item.Caption = Val(temp) + 1
End If
|
|
|
|
|
What is it that you are trying to do?
You are looping throught the values only to get the last value. Why don't you reverse the sorting and get the first value instead?
---
b { font-weight: normal; }
|
|
|
|
|
I wanna get the last value contain in the databse then Increase value when i add new item. u know wat i mean??
Like the record now have 1,2,3 item in bill no1, when i add item the item NO will become 4.
Same for my bill no2 will be the same also start from 1,2,3.
but now my bill no2 have continue start the number form bill no1. which is 4,5,6 ... i want to make it restart to from 1.
|
|
|
|
|
Get the highest number for that bill from the database then. SQL example:
"select max(ItemNumber) as Highest from Items where BillNumber = 2"
---
b { font-weight: normal; }
|
|
|
|
|
campbells wrote: temp = rr![item] where dono.Text = rr![NO]
This isn't possible in VB6, or VB.NET 2002, 2003, or 2005. Something like this will show up in the LINQ extensions to C# and VB.NET.
If you're looking for the next highest number, why no get it from the database?? If that field is Auto Incremented, the database keeps track of this for you.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
yes i finding the highest number but according to the specific number only but it not working, my coding like.. did not check the bill no but it just get the highest number in any of those bill...
like Bill no1 have item 1,2,3.
when i create the bill no2 suppose when i add item it will become first "1" for the first time but it goes to number "4"
do u get wat i mean??
|
|
|
|
|
You're not getting what we're telling you. You don't have to track the bill number yourself. The database can do it for you! If your bill number field in the database is an Auto number field, it will track when the next number is supposed to be for you.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
my access databse dont track for me, and i increse the value myself in vb.
unless u tell me there is wat to do it.
I have 2 table, 1 is the "bill record" and sales "item record" which it refer to to wat item customer bought from bill record.
The "bill record" have unique have No. but the "item record" dont have , so everything will junk in there. like it may have bill no1- candy-$1, no1-chocolate-$2.
and i dont undertsnad wat u mean auto number field, i using data grid and i didnt see the function for it to auto field in number itself.
|
|
|
|
|
AutoNumber is in the Access database table definition, not is Visual Studio, VB.NET, or the DataGrid. Each table should have its own Primary key, which is usually an AutoNumber field.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
ya i did put primary key but not sure wat u trying to tell me.
|
|
|
|
|
Go into Access and Design your database table. When you define the fields of your table, one of the field type options, the column after your field name, is AutoNumber.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
is it possible to set the data grid when user click on the column it will do ascending sort or descending sort?
|
|
|
|
|
Yes. How it's done depends greatly on the version of VB or VB.NET you're using.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i'm using VB6, but i didnt found the function on the properties...
|
|
|
|
|
It's been 6 years since I've used VB6...Let me see...IIRC, the VB6 DataGrid doesn't have any support built in for sorting. I think you had to sort the ADODB.RecordSet you bound the grid to. There was a Sort property on the Recordset object that you set something like this:
myRecordSet.Sort = "LastName ASC, FirstName ASC, Age DESC"
My VB6 is pretty rusty so don't take this as The Official Word...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hello.
Basically I am trying to modify mouse events in a VB web browser. My first goal was to try and make a right click on the AxWebBrowser control to act as a left click. So both mouse buttons would act as left click. Yet when I was messing with some code it seems AxWebBrowser doesnt have MouseEvents ?
This is the code I am using to detect a mouse click on the control, but I get error!
Private Sub AxWebBrowser1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles AxWebBrowser1.MouseDown
If e.Button = MouseButtons.Right Then
'do something
End If
End Sub
Any information on trying to work with mouse events and a web control would be nice.
Thanks
|
|
|
|
|
This won't do what you want it to anyway. You can't change the mouse click inside the event handler. The mouse "event", message really, will still get passed to the Browser as a right-click.
The only place you can change buttons clicked on is using a global mouse hook. You have to change the mouse message BEFORE your application ever gets it.
-- modified at 23:17 Tuesday 15th August, 2006
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hey all
I'm confused here. I have an mdi application which will recognize keystroke that i hit. However, it seems to recognize the hit when it's first time loaded. After that, if I switch the focus to another window, it wont recognize the hit anymore. How can I make it recognize the hit everytime it's got focus?
Thanks
|
|
|
|
|
Try using event Got focus... on that other form...
|
|
|
|