Search results

  1. T

    GotoRecord determined by several values

    After running the query, in the design mode the numbers in the criteria-fields are just stated as numbers. No quotes or something like that are added. This is the sql: SELECT dbo_EU_Products_koppeling.PesWebID, dbo_EU_Products_koppeling.EU_psu_nr, dbo_EU_Products_koppeling.EU_pdg_nr...
  2. T

    GotoRecord determined by several values

    It is a pity, but when I paste the result of the debug into a WHERE clause in a query, just as you suggested, the query runs fine. The correct record is shown in the datasheet view. Strange... Any more ideas?
  3. T

    GotoRecord determined by several values

    Ah, ok. That immediate window I did not know. Can be helpfull. When I run your testcode this is what appears in the debug window: EU_psu_nr = 1 And EU_pdg_nr = 1 And EU_psg_nr = 0 And EU_pro_nr = 1 And psu_nr = 1 And pdg_nr = 9 And psg_nr = 5 And pro_nr = 16 And pro_nr_hoedanigheid = 1 These...
  4. T

    GotoRecord determined by several values

    Thanks. I think some quotes or something like that are still missing in your code, while now I get the error "Compile error. Expected: end of statement". Probably it is very basic, but well... not for me at the moment :-( You are right that all the fields are numeric. Can you have again have a...
  5. T

    GotoRecord determined by several values

    Hi, I am trying to go to a specific record on a form. This is de code I use as event procedure of a button: DoCmd.GoToRecord acActiveDataObject, , acGoTo, "EU_psu_nr = " & Me.ZEU_psu_nr And "EU_pdg_nr = " & Me.ZEU_pdg_nr And "EU_psg_nr = " & Me.ZEU_psg_nr And "EU_pro_nr = " & Me.ZEU_pro_nr...
  6. T

    Delete records with null values

    Thank you for your advice. I am not sure whether a select query would make the difference, while I already can see which records I select in the listbox. Anyhow, I have been trying to make the query work and this is what is working now: Dim strSQL As String If Len(Me![Listbox].Column(4) & "")...
  7. T

    Delete records with null values

    Hi, I am trying to delete a selected record with the following code: Private Sub BtDelRecord_Click() On Error GoTo Err_cmdSaveRecord_Click Dim strSQL As String strSQL = "DELETE * FROM [dbo_Conversie_lokatie] WHERE [dbo_Conversie_lokatie].[CONVERSIEPROG_NAAM] = '" & Me![Listbox].Column(0) &...
  8. T

    Distinct count of records

    GREAT! It works. :) Thank you very much!
  9. T

    Distinct count of records

    Yes, you are wright. It should be of course something like: Me![Text12].Value = DCount("[bmp_id]", "[Leverantie vs meetgegevens]", "[Leverantie vs meetgegevens].lev_id = " & CbLeverantie.Column(0) & "") But it looks like that in this code it is not possible to insert a distinct. Thats why i...
  10. T

    Distinct count of records

    Hi, I am trying to make a distinct count of records from a dataset that is generated by the following code: sSql = "SELECT * FROM [Leverantie vs meetgegevens] WHERE [Leverantie vs meetgegevens].lev_id = " & CbLeverantie.Column(0) & " ORDER BY bmp_id, methode;" [SF Leverantie...
  11. T

    Multiselect listbox to add records to a table

    YES! it works! :) Thanks very very much for all your suggestions. Private Sub BTtoevoegen_Click() Dim strSQL As String Dim db As DAO.Database Dim rs As DAO.Recordset Dim ctl As Control Dim varItem As Variant On Error GoTo ErrorHandler Set db = CurrentDb() If...
  12. T

    Multiselect listbox to add records to a table

    Hi, As suggested by Mr. B, I disabled all the error handling codes, put a temporary variable, assigned the values from the multiple select listbox to it, put a breakpoint to the line and run the code. Now I got the error message: "Run-time error 3265 Item not found in this collection" on the...
  13. T

    Multiselect listbox to add records to a table

    Thanks. These are good ideas. Unfortunately I am not able to try this at the moment(got sick and can not access database at home), so the outcome of your suggestions will come later.
  14. T

    Multiselect listbox to add records to a table

    Thanks for your suggestion. The problem, however, does still exists when I change that line :( The value from the listbox is not added... In your suggestion I miss an link to the column in the listbox. Thats why I had typed: rs!pro_id = ctl.ItemData(ctl.ItemsSelected(0)) But you are right...
  15. T

    Multiselect listbox to add records to a table

    Hi, I have a form with an multiselect listbox (ListKAPprodukten), a textbox (TBvor_id) and a Command button. On click of the command button, I want to add the selected items of the listbox and the value of the textbox to a table (dbo_residunorm_nieuw), that is shown in a subform. I found on...
  16. T

    Compile/Syntax error in notation of VBcode

    Of course... Great! Thanks. Greetings from Utrecht
  17. T

    Compile/Syntax error in notation of VBcode

    Hi, I am trying to set a value (vor_id) by using a select-statement: Form_22BeherenResidunormen.vor_id = select dbo_verontreiniging.vor_id FROM dbo_verontreiniging WHERE dbo_verontreiniging.sto_id = " & CurrentStof & " I get the following message: "Compile error. Expected: expression". I...
Back
Top Bottom