Lowyat.NET Forums

Welcome Guest ( Log In | Register )

 
RSS feedBump TopicClosed TopicStart new topicStart Poll

Outline · [ Standard ] · Linear+

> VB help needed, Simple database program (VB)

stng
post Jul 4 2009, 07:58 AM
Show posts by this member only |This post's rating (0+, 0-) | Post #1


Getting Started
**

Group: Junior Member
Posts: 57
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: May 2005
From: Home:Kulim:S-Kedah 0124883066





I need to write a simple database program that can help me verify and detect duplicate serial no and can log the data to exel at my working place,anyone can help me ?

The data i need are :

1. Serial no.
2. Date and Time

example:
1. scan serial no if got duplicate will prompt out box said duplicate s/n .

thanks in advance..




User is offlineProfile CardPM
Go to the top of the page
+Quote Post
wodenus
post Jul 4 2009, 11:48 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #2


Tree Octopus
*******

Group: Senior Member
Posts: 9,601
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jan 2003





Why do you need for it to be in VB?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
ubsacc2004
post Jul 5 2009, 07:46 AM
Show posts by this member only |This post's rating (0+, 0-) | Post #3


Regular
******

Group: Senior Member
Posts: 1,210
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Sep 2006
From: KL





you can create a function or u can use recordset sql statements to select count before u insert into table.

VB6

read above url and HTH.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
stng
post Jul 7 2009, 08:50 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #4


Getting Started
**

Group: Junior Member
Posts: 57
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: May 2005
From: Home:Kulim:S-Kedah 0124883066





How to make the cursor go back to the text box after i scan in certain
data


Added on July 7, 2009, 8:50 pmPrivate Sub cmdSave_Click()


Dim FileNo As Integer
Dim Rec As String
FileNo = FreeFile

Open App.Path + "\SN.CSV" For Append As #FileNo

If txtSN.Text <> "" Then
Rec = txtSN.Text + "," + CStr(Format(Date, "dd/mm/yyyy")) + "," + CStr(Time)
Print #FileNo, Rec
End If

Close #FileNo

MsgBox "Record Saved.", vbInformation + vbOKOnly, "Save Record"
txtSN.Text = ""




End Sub

This post has been edited by stng: Jul 7 2009, 08:50 PM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
silvadesk
post Jul 8 2009, 10:25 AM
Show posts by this member only |This post's rating (0+, 0-) | Post #5


Getting Started
**

Group: Junior Member
Posts: 76
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Mar 2008




vbcode.com

very helpful site.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
shahnazz
post Jul 8 2009, 10:30 AM
Show posts by this member only |This post's rating (0+, 0-) | Post #6


Newbie
*

Group: Junior Member
Posts: 27
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: Jan 2003





after txtSN.Text = "", add:

txtSN.SetFocus
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
stng
post Jul 8 2009, 06:36 PM
Show posts by this member only |This post's rating (0+, 0-) | Post #7


Getting Started
**

Group: Junior Member
Posts: 57
Ratings earned: 0+, 0-
Ratings given: 0+, 0-

Joined: May 2005
From: Home:Kulim:S-Kedah 0124883066





QUOTE(shahnazz @ Jul 8 2009, 10:30 AM)
after txtSN.Text = "", add:

txtSN.SetFocus
*



I try but still the cursor can't go back to textbox

My form got one

textbox and save button
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Bump TopicClosed TopicTopic OptionsStart new topic
 



----debug section please ignore----
Lo-Fi Version Time is now: 25th November 2009 - 03:22 PM
All Rights Reserved 2003-2009 Vijandren Ramadass (~living on a prayer~)