i have tried nothing happend.the correct event is the change
event
Ok... Can you upload your sample code...????
i have tried nothing happend.the correct event is the change
event
Ok... Can you upload your sample code...????
Why don't you write it in the Click() event...???
Like this:
Private Sub DTPicker_start_hour_click()
refreshRs
End Sub
Q 1. Do i need to create separate recordset for each alphabet (A-Z) ?
Ans: Why don't you create some labels or listbox, so that you can display the alphabets. When user clicks on the alphabet, use the database to fetch the data...
Q 2. How do i get the 1st letter of the name entered into a textbox ? (hav heard that "VB Controls" help...but couldnt find a control to help me..)
Ans: Try this code:
Dim strFirstLetter as string
strFirstLetter=left(trim(Text1.text),1)
)
Q 3. if answer to 1st question is "no" how do i store & Retrieve names of particular alphabet from database when user clicks a label of that alphabet?
Ans: Use a separate data Field in your table to store the Alphabets
Good luck :)
If cuno is of numeric type, then this will be more suitable:
"SELECT * FROM Bill WHERE ID= " & val(text1.text) & " "
If it is of Text type then,
"SELECT * FROM Bill WHERE ID= '" & trim(text1.text) & "' "
Assuming that you are using MS Access database... :)
Use a Timer control in your form. Then write the below code:
Dim Start_Time As String
Private Sub Form_Load()
Start_Time = Time
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
Me.Caption = "Elapsed Time: " & Format(DateAdd("s", DateDiff("s", Start_Time, Time), "0:0:0"), "hh:mm:ss")
End Sub
I am not sure... But why don't you try removing the line:
rs.Close
and check whether it is working or not... :)
Hi, I am Akhilesh B Chandran.
I am from Kerala(India). I love programming, graphic designing, animation, gaming, etc...
I am specialized in VB6
I am 19years old.
Present status: studying B.Tech (Computer Science)
I am always to help anyone... :)
Thank you !
- Akhilesh
don't mind. why you use it plz.....
Sorry... I was in a hurry.... Didn't looked that.... :D
I was just combining the codes that were already posted....
Thanks for pointing out...
VALUES (" & txtcclientnumber.Text & ", " & cmbs.Text & ", " & txtccopies.Text &
You are missing this '(single quotes).... :)
What kind of connection are you using? DAO or ADO ?
How do you access the database...???
In ADO, an exapmle is:
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = New ADODB.Connection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source= " & App.Path & "\database.mdb;Persist Security Info=False;Jet OLEDB:Database Password=ElE;"
cn.Open
Look at the 6 line of code...
If the database is residing in the same folder(ie. application folder), then, for example if you have installed in "C:\mysoft" folder,then
App.path & "\database.mdb" gives C:\mysoft\database.mdb
Dim DBase As Database
Dim RBase As RecordsetSet DBase = OpenDatabase("DB Name")
Set RBase = DBase.OpenRecordset("Table name")
Try to use database name and table names without spaces. eg: DBName , TableName...
Which line shows the error ?
Make sure that the data saved to the database is of the same datatype of those in the Fields...
eg: "abcd"(string) to IntegerField is not applicable...
Private Sub Command1_Click()
Dim username As String
Dim password As String
username = Trim(txtUser.Text)
password = Trim(txtPass.Text)
If username = "dawid" And password = "qwerty" Then
MsgBox ("Welcome," & " " & username)
Dim age As Integer
age = Val(txtAge.Text)
If age >= 18 Then
MsgBox "You are " & age & ", let's go to the pub!"
Else
MsgBox "You are " & age & ", you can't drink!"
End If
Else
MsgBox (" Sorry, access denied, please check your username and password and try again")
End If
End Sub
How about this ?
on error goto Er
r.Fields("companyphone") = txtcphone.Text
r.Fields("companywebsite") = txtcwebsite.Text
exit sub
Er:
msgbox "Error occured"
Please post your entire code inside save button...