Search results

  1. M

    SQL Error 13

    Thank you Estuardo! I did what you said but I'm still getting the same error:banghead:
  2. M

    SQL Error 13

    I need some help from you guys. I got the following SQL which I would like to run with vba but it gives an error (errror 13 type mismatch). The SQL does work when I use it in a query but not in vba:banghead:. Dim SQLobsoleteperc As String SQLobsoleteperc = "SELECT...
  3. M

    Replace part of the string

    Thank you all for answering! I used the Replace statement and the code is now working perfectly! I wish you all a great 2014!
  4. M

    Replace part of the string

    Dim SourceSubFrmParts As String SourceSubFrmParts = subfrmEmptyParts.SourceObject I would like to extract a part of the string which is assigned to SourceSubFrmParts and replace it with something else. The first six letters, which always will be 'subfrm', which in all cases have to be...
  5. M

    update and delete query with vba

    pr2-eugin thanks for you reply:D! No I didn't try this code because I don't want to delete the entire row in tblSubComponent. In this table only the refference to the ActionID has to be deleted. tblActionsTaken contains the detailed information about the acitons, which should be deleted...
  6. M

    update and delete query with vba

    Thanks for the answers! The code does update tblSubComponent but it doesn't delete the row from the other table which requires the ActionID in the where clause. I want the code to update the value in [tblSubComponent]![ActionID] to NULL (which it does). After that I would like to delete the...
  7. M

    update and delete query with vba

    Two things I would like to do with this vba code: Update a value from one table and save the ID as DeleteID Use the DeleteID in the where clause of a delete query I got the following code but it doesnt work as intended. Could someone please help me with this: Dim myDb As...
  8. M

    Append and update query with vba

    The Update query works fine but the delete sequence doesn't work properly. Could you tell me what I am doing wrong? The intention of the code is to delete the selected action from the Action table and remove the link in tblSubComponent. Dim myDb As Database Dim rst As...
  9. M

    Append and update query with vba

    The reason I'm updating one table and deleting the second is due to the fact that in tblAltPart, the ActionID has to be removed, and in tblActionsTaken the action has to be removed completely. Therefore I made two seperate sql's. Now I see that I accidentally used one table in both codes. It...
  10. M

    Append and update query with vba

    CJ_London, thanks for you quick reply :)! If I put it i the same procedure as the previous it results in: Dim myDb As Database Dim rst As Recordset Set myDb = CurrentDb myDb.Execute ("UPDATE tblAltPartSet ActionID=NULL WHERE AltPN='" &...
  11. M

    Append and update query with vba

    CJ_London, I got an follow up question regarding this case. I would like to delete an action from a part and subsequently delete the action from tblActions. To make this happen I think I should do the following: Use an update qry to remove the ActionID from tblAltPart. Something like: UPDATE...
  12. M

    Append and update query with vba

    Thank you very very much CJ_London!! Your my hero :D The more I work with vba for Access the more I see that punctuation is critical an even one slight thing could lead to very different results :banghead:.
  13. M

    Append and update query with vba

    tblActionsTaken is of datatype Yes/No. Which ofcourse is boolean. So your assumption is correct ;).
  14. M

    Append and update query with vba

    The combobox isn't empty and I included a procedure to force the user to select a value: If lstLastTImeBuy = "" Then MsgBox "Please select a if Last Time Buy has been done" Exit Sub End If In the immediate window the value "True" is showed after running the debug code...
  15. M

    Append and update query with vba

    Thanks for your time! Yes, ofcourse ;) ControlSource=Nothing rowsource="Yes";"No" rowsource type=Value List bound column=1 columncount=1 columnwidths=Nothing filled in name=lstLastTImeBuy
  16. M

    Append and update query with vba

    CJ, sorry if I don't understand it well but I've tried altering the code with the things you said. Without the yes/no field it seems to work correctly but with that part I continuously get the same error. Doesn't work: myDb.Execute ("INSERT INTO tblActionsTaken (LastTimeBuy, ActionDate...
  17. M

    Append and update query with vba

    Thanks CJ_London! While editing the code, I accidentally forgot to add the third field. I also found two misspelled names. This part of the code should be: myDb.Execute ("INSERT INTO tblActionsTaken (LastTimeBuy, ActionDate, ActionDetails) " & "VALUES(" & Me.lstLastTImeBuy = "Yes"...
  18. M

    Append and update query with vba

    CJ_London, I've implemented the code into the database as followed: Note that I changed the value to Yes instead of True, because I changed the value of the combobox to "Yes";"No". Dim myDb As Database Dim rst As Recordset Set myDb = CurrentDb myDb.Execute...
  19. M

    Append and update query with vba

    Thank you very much CJ_London! I will try this and get back to you if neccessary.
  20. M

    Append and update query with vba

    Hi, I got two questions: 1. I have written a vba code which should append data to a table called; 'tblActionsTaken". The data is given by the user. access works with 2 of the 3 fields. The third field (or first in de vba code) gives an error. The value is selected in a combobox containing a...
Back
Top Bottom