Jump to content
Xtreme .Net Talk

techmanbd

Avatar/Signature
  • Posts

    405
  • Joined

  • Last visited

Everything posted by techmanbd

  1. dim RESULT as dialogresult RESULT = messagebox.show("Are you sure you want to update that record?", "Are you sure?", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question") select case RESULT Case dialogresult.no -code for no- case dialogresult.cancel -code for cancel- case dialogresult.yes -code for yes anser- end select now you only have it shown once
  2. actually you should write it differently. I will put up somethng in a sec
  3. you need to EXIT SUB within all the if statements.
  4. You can do the following: Private Sub text1_keypress(ByVal sender As System.Object, ByVal e As KeyPressEventArgs) Handles TextBox1.KeyPress Dim intDeccheck As String intDeccheck = Microsoft.VisualBasic.InStr(Me.TextBox1.Text, ".", CompareMethod.Text) If (Asc(e.KeyChar) = 46) Then If intDeccheck > 0 Then e.Handled = True End If End If End Sub
  5. Ah, ok, so kind of like tricking it thining the program did save.
  6. Well I found my own answer Had to put: xlApp.ActiveWorksheet.Saved = TRUE I am a little confused though, maybe someone can shed some light this is what I had before xlApp.ActiveWorksheet.Saved = FALSE And this would pop up "DO you want to save changes" I made it true and the pop up doesn't come up, but also doesn't save what i put into the excel sheet. My mind set is if I set to TRUE it would save. But it doesn't. It just doesn't ask If I want to save. So any ideas?
  7. In my code I open an excel sheet, already made up, that inserts info into certain cells then I print it out. No when I close the excel workgroup I get the message ----- If I Want To Save My Changes. generated from the excel program when closing I remember way back in the day with VB5 that I was able to set something so that it would basically not ask that. I don't want to save what I inserted. Anybody know the command? Thanks
  8. me.button1.text = chr(ASCII CODE NUMBER)
  9. Below is something I did similar to what you want. I am using access. and adding names. Also before I add names I check ro make sure that the name has never been added. Private Sub insertName() ' Checks to make sure name doesn't exists, if names exists then will not ' allow to add name. If name doesn't exist then adds name to database. Dim strCommand As String Dim myconnection As New OdbcConnection(strConnect) myconnection.Open() strCommand = "select * from tblUserinfo where First_Name = '" & _ Me.txtFirst.Text & "' and Last_Name = '" & Me.txtLast.Text & "'" Dim mycommand As New OdbcCommand(strCommand, myconnection) Dim myreader As OdbcDataReader = mycommand.ExecuteReader If Not myreader.HasRows Then myreader.Close() mycommand.Dispose() strCommand = "INSERT INTO tblUserinfo (EMPID, First_Name, Last_Name) Values ('" _ & Me.txtEMPID.Text & "', '" & Me.txtFirst.Text & "', '" & Me.txtLast.Text _ & "')" mycommand = New OdbcCommand(strCommand, myconnection) mycommand.ExecuteNonQuery() Else MessageBox.Show("NAME ALREADY EXISTS!") End If myconnection.Close() myreader.Close() mycommand.Dispose() End Sub
  10. In my code I open an excel sheet, already made up, that inserts info into certain cells then I print it out. No when I close the excel workgroup I get the message ----- If I Want To Save My Changes. generated from the excel program when closing I remember way back in the day with VB5 that I was able to set something so that it would basically not ask that. I don't want to save what I inserted. Anybody know the command? Thanks
  11. check out the sample that comes with the msdn library called: VB.NET - Framework - Using the COM Port in VB.NET There is a module they use called "RS232". Add that to your program them check out the examples in that sample. Taht is what I did and it works great once you figure out what they are doing in the sample.
  12. techmanbd

    mscomm

    Don't use mscomm for vb.net check out the sample that comes with the msdn library called: VB.NET - Framework - Using the COM Port in VB.NET There is a module they use called "RS232". Add that to your program them check out the examples in that sample. Taht is what I did and it works great once you figure out what they are doing in the sample.
  13. Goto Menu PROJECT - click on the project PROPERTIES in the COMMON PROPERTIES click on BUILD and then there is "APplication Icon"
  14. I have a datagrid with a table in it that i brought in from my database. What I would like to do is when I do a new search, if no rows comes back then delete the table with info out of the datagrid so all they see is the datagrid box with nothing in it In the beginning of the sub I tried dim tbl as datagridtablestyle = new datagridtablestyle tbl.mapping = strTable me.datagrid1.tablestyle.remove(tbl) so am I missing somthing, or totally of the track thanks, for any help
  15. I belive you need a WHERE statement or else it doesn't know what to exactly update "UPDATE VehicleInventory SET Image = '" & PicPath & "' WHERE image = something"
  16. I am filling a datagrid with info I pulled in from from my database. Everything works like I want it to but one thing. The column size. Is there a way to basically autosize with what info is there. It brings back "Social Distortion" but all I see is "Socia" until I take the mouse to the column line and double click and the column snaps to the end of the text. i wou;ld like it to come up like that automatically. This is my Code Private Sub datagridit(ByVal strCommand As String, ByVal strTable As String) Dim myDataAD As New OdbcDataAdapter Dim myConnection As New OdbcConnection(strConnect) myConnection.Open() Dim myCommand As New OdbcCommand(strCommand, myConnection) Dim ds As New DataSet myDataAD = New OdbcDataAdapter(myCommand) myDataAD.Fill(ds, strTable) Me.DataGrid1.DataSource = ds.Tables(strTable) Me.DataGrid1.RowHeaderWidth = 0 myConnection.Close() myCommand.Dispose() myDataAD.Dispose() End Sub
  17. I wrote a program that uses MS Access for a database. I know that if I deploy my program they have to have MS access on there computer My question is, if there is a way when packaging my program, to package the contructed database with tables and queries, that way I don't have to set up a database everytime I put the program on the computer. the program is just a local program for an individual computer
  18. I wrote a program that uses MS Access for a database. I know that if I deploy my program they have to have MS access on there computer My question is, if there is a way when packaging my program, if there is a way to package the contructed database with tables and queries, that way I don't have to set up a database everytime I put the program on the computer.
  19. Private Sub button1_hover(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.MouseHover Button1.Focus() End Sub
  20. never mind, I see you found it, didnt read that part
  21. I used "*" in access and I get a result. SELECT * FROM tblArtist WHERE Artist_Name LIKE 'So*'; And I get Social Distortion So why your,s doesn't work, don't know. Maybe you should throw up your code so we all can see. Maybe something in there.
  22. Combobox
  23. It is hard to say without seeing the code itself. If you can post it and change wording if you want, then maybe we can figure it out
  24. insert into Cust (CustID, FirstName, LastName) values (?,?,?) try putting this symbol around the values ' so it looks like this insert into Cust (CustID, FirstName, LastName) values ('?','?','?')
  25. No problem, sorry it took so long, but didn't see that right away. Eyes were failing.
×
×
  • Create New...