Click here to Skip to main content
15,897,090 members

Comments by Michael Sernal (Top 12 by date)

Michael Sernal 13-Feb-14 4:40am View    
An update Guys, I recoded it, and now I'm having a different error. It goes like this "no. of query values and destination fields are not the same." My table in my ms access database is consist of 3 columns namely, ID, Username, and Password.
Note: ID is auto-numbered by the DB. That's why I only need txtUname.text and txtPass.text to be saved on my DB.
So does anyone have any idea how will be able to save the data with just the 2 since the ID is auto numbered by MS access? Thanks.

Private Sub bAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bAdd.Click
Dim objConn As New OleDb.OleDbConnection
Dim connStr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Avatar\Documents\Visual Studio 2010\Projects\Invent\Invent\mdbInvent.accdb;User ID=admin"
Dim ins As New OleDb.OleDbCommand
Try
objConn.ConnectionString = connStr
objConn.Open()
ins.Connection = objConn
ins.CommandText = "INSERT INTO tblUsers VALUES(@Username, @Password)"
ins.Parameters.AddWithValue("@Username", txtUname.Text)
ins.Parameters.AddWithValue("@Password", txtPass.Text)
ins.ExecuteNonQuery()

Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

End Sub
Michael Sernal 18-Jul-12 17:44pm View    
Thanks Kschuler,

I'm thinking of the same way, but you see this text object is a comment field and I don't have any idea how many characters a user will input. So if I reduce the width and height of the text-object and the user will input a lot then not all characters will be displayed and if I will increase it's size then it would would consume a lot of space. Does this mean I will make estimates on how big this text-object would be so that I will be able to cater how many lines of text to display?
Michael Sernal 6-Jul-12 14:13pm View    
What if you have multiple rows? do other td's follow to the ones you put the id to? because i already have classes and my table contains multiple rows, thanks.
Michael Sernal 18-Jun-12 9:23am View    
hi vijay bisht,

I think i have already explained it well. I have a crystal reports and it's detail section is divided into 3 like detail section 1, 2, and 3. the problem is when the report is generated there a two extra pages 4 and 5 which are the copy of details section 1 and 2 or shall i say pages 1 and two. For the details on how i divided the detail section into three i think i mentioned it above in section expert. Thanks.
Michael Sernal 15-Jun-12 10:21am View    
hello losmac, hi guys,

i saw two checkboxes under the paging tab of the details section new page after, namely: "end of section" and "visible records". i only checked one which is the end of section and in the formula editor i pasted the code you posted above and i think im doing it wrong because i'm not getting the results i wanted. I also tried doing it with the other checkbox and having the 2 of them checked and still no luck. Do i have to edit something here like this or how is it done? Thanks for being patient.

if recordnumber = 15 then
display only 5 records per page which makes it 3 pages.