Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. StlMacMan

    Update Method Help

    I have a VB6 form into which users enter data which is saved to an Access 2002 db. At a later time it will need to be edited since there are several date fields that will need to be updated. I don't understand what the syntax would be to identify which component is updated, or do I simply call...
  2. StlMacMan

    Design/Method Question

    Thanks for the responses. "GM" I don't mind the philosophy. I am a professional philosopher doing social service work. This program tracks dozens of contracts for the agency for which I work. By and large a single user will be doing the initial entry and editing. "Chip" it happens with...
  3. StlMacMan

    Design/Method Question

    I have a VB6 program w/ several forms, one of which is the main input form for data which is then stored in an Access 2002 db. The other forms display the stored data depending on which fields the user uses to search by. Several of the fields on the input form will be left blank when used. As...
  4. StlMacMan

    Empty Date Field Problem

    Thanks to all who helped. W/ Roy-Vidar's basic schema and ArteChoke's Len comments by removing the first half of the test and only using the Len component, it now builds a sql string w/ only the non-blank fields. Unfortunately because I have default text in some of the fields, if the user hits...
  5. StlMacMan

    Empty Date Field Problem

    You are correct. I did try if not isnull(txtFirstDate.text) then I tried your suggestion--had to add an extra set of () before Len and after 0--got exactly the same response. It lists all the fields and all the values showing the blank dates as '##'. Any idea why it is not omitting the...
  6. StlMacMan

    Empty Date Field Problem

    Thanks New Guy. I'm happy to say I figured that out :) which feels so good. Any idea why I'm getting the date error message. This whole thread and 3-week frustration is about trying to save a partial form to an access db when there are empty date fields on the form. Whew. It is a killing...
  7. StlMacMan

    Empty Date Field Problem

    Printed to the Immediate window and discovered that the strSql statement contained an extra comma because you removed one character but had added a space after the comma. Changed it to -2 and it looks fine and removed that error message. Now the error message is my old favorite: Syntax error...
  8. StlMacMan

    Empty Date Field Problem

    OK, I've rewritten my "save" code and while I don't see errors in the Debug Locals window, I do keep getting a runtime error message : Syntax error in INSERT INTO statement. Locals shows me that all the db fields are part of the strsql stmt even when the strval stmt includes nulls. Null dates...
  9. StlMacMan

    Empty Date Field Problem

    Roy-Vidar, you're a smart dude. Where do you teach? Can you tell me the purpose of this part of your code? strsql=mid$(strsql,1, len(strsql)-1) & ")" strval=mid$(strval,1, len(strval)-1) & ")" Con.Execute strsql & strval Thanks.--Ed
  10. StlMacMan

    Empty Date Field Problem

    Do you mean that I should write some kind of conditional that tests for a valid date and then only insert those?
  11. StlMacMan

    Empty Date Field Problem

    WindDrinker--I like your solution, but I am unsure what to do with the fact that 10 of the other 17 fields on the form are date fields that might be blank. Is there some efficient way to write this (like maybe a complex conditional of some sort) that would make it practical to use this method...
  12. StlMacMan

    Empty Date Field Problem

    Dim rs As ADODB.Recordset Dim Con As ADODB.Connection Dim ssql As String Const strCon = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=C:\Documents and Settings\EdM.SALVARMY\My Documents\Test.mdb" Private Sub CmdSave_Click() BiggerBrother--I just cannot figure...
  13. StlMacMan

    Empty Date Field Problem

    I tried your suggestion and still get an error message about syntax in the INTO statement. I'll try to play around w/ the syntax. It looks right to me, but the only think I changed is the code you suggested. I tried filling in the other 17 fields and just leaving the Date-Filed empty. Still...
  14. StlMacMan

    Empty Date Field Problem

    I have several text boxes in a VB6 entry form that take short dates and save them to an Access 2002 db. If I fill them all it works fine. If I leave any one of them empty I get the following error message: Syntax error in date in query expression '##'. The code used to Enter and Save them...
  15. StlMacMan

    Date conversion(?) as part of sql query

    Figured it out. The correct sql is: "SELECT * FROM Contract " _ & "WHERE year(Start_Date) = " & Form3.TxtCtrtYear.Text & "" Part of the issue was my failure to reselect the ADO DC on the form after I had copied the main form fields from an earlier form. Doh! Thanks to all who responded. --Ed
  16. StlMacMan

    Date conversion(?) as part of sql query

    Jebenson-- The "1=0" attempt didn't help. Same error message. I can't figure out why this is so hard! The text box entry is just "general" format and the user enters e.g., 2004 I am using the sql query below and entered it into the RecordSource property of the ADO dc as well. No luck. Very...
  17. StlMacMan

    Date conversion(?) as part of sql query

    Here it is. The bulk of the work is done by the ADO bound data control. Private Sub Form_Load() AdoGroupYearSearch.CommandType = adCmdText AdoGroupYearSearch.RecordSource = "SELECT * FROM Contract WHERE Year(Start_Date) = " & Form3.txtCtrtYear.Text & ""...
  18. StlMacMan

    Date conversion(?) as part of sql query

    Doc--I still get the same error message: Object variable or With block variable not set. When I hit Debug it highlights AdoGroupYearSearch.Recordset.Requery When I worked out the other two, this appeared to be caused by the RecordSource property of the ADODB dc being out of sync w/ the code...
  19. StlMacMan

    Date conversion(?) as part of sql query

    Jebenson, thanks for the reply. I had to remove your " in order to get it to take it as sql. Here's the code. Private Sub Form_Load() AdoGroupYearSearch.CommandType = adCmdText AdoGroupYearSearch.RecordSource = "SELECT * FROM Contract WHERE Year(Start_Date) = & Form3.txtCtrtYear.Text"...
  20. StlMacMan

    Date conversion(?) as part of sql query

    I have a VB6 form with bound ADODB dc which needs to query (adcmdText sql SELECT)an Access 2002 db table date field in order to match a user input textbox entry (TxtCtrtYear) on the form and then display matches. The Access date field (Start_Date) is formatted as short date and so is the display...

Part and Inventory Search

Back
Top