Search results

  1. A

    Last ID

    Is this what you mean? Private Sub Command0_Click() Dim db As DAO.Database Set db = CurrentDb db.Execute "INSERT INTO SB_Test (TestText) VALUES ('SOMETHIGN ELSE123')" Dim qdf As DAO.QueryDef Dim rs As DAO.Recordset Set qdf = db.CreateQueryDef("") qdf.Connect = "ODBC; Driver={MySQL ODBC 5.2...
  2. A

    Last ID

    right I have got this far, but I am still getting back just a 0 value every time, running the query in access works fine, but nothing here Private Sub Command0_Click() CurrentDb.Execute "INSERT INTO SB_Test (TestText) VALUES ('SOMETHIGN ELSE')" Dim qdf As DAO.QueryDef Dim rs As DAO.Recordset...
  3. A

    Last ID

    Nope its got me beat. I have created a pass through query in the query designer and it returns the value I am looking for. But I have absolutely no clue how to translate this into VBA/Get the result from this query into VBA. Any feel like helping me out here please?
  4. A

    Last ID

    Yeah just came to the same conclusion, trying to suss it out now. Thanks
  5. A

    Last ID

    Nope, just returns a value of 0 every time.
  6. A

    Last ID

    hi guys, I have just moved by Access BE across to MySQL BE at the insistence of the IT dept, and am having a couple of problems with things. One of these been getting the ID last a record that has just been inserted. I used to get this no problem when it was an Access BE by using .bookmark...
  7. A

    VBA, Decimal Data Type and MySql

    Set db = CurrentDb Set rsOsirisAdd = db.OpenRecordset(Name:="meter_new", Options:=dbSeeChanges) UOM = FormatNumber(Me.txtUOM.Value, 2) Debug.Print UOM With rsOsirisAdd .AddNew ![SerialNumber] = Me.txtSerial ![MeterTypeID] = 1 ![OboxID] = 1...
  8. A

    VBA, Decimal Data Type and MySql

    Same error
  9. A

    VBA, Decimal Data Type and MySql

    I had tried something similar before and no joy, just tried now and still the same thing.
  10. A

    VBA, Decimal Data Type and MySql

    Hi All, I am having some problems getting VBA to create an entry into a MySQL backend. The value I want to enter is from a text box on the form, say with the value of 0.5, and going into a MySQL DB, with the data type of Decimal - Length 5,2 I keep getting runtime error 3759 - Data...
  11. A

    Open a report

    The report is based on a query, but there's nothing wrong with the query. The report opens elsewhere and is absolutely fine, I can't even get the report to open, it doesn't get as far as opening the report to error on a problem with the query, it throws an error saying the report cannot be found...
  12. A

    Open a report

    Private Sub cmdReport_Click() Dim Report As String If IsNull(Me.lstResults) Then MsgBox "Select transaction to view.", vbCritical Else Report = DLookup("[DefaultReport]", "tblLogTypes", "[ID] = " & DLookup("[LogTypeID]", "tblGeneralStockLog", "[LogID] = " & Me.lstResults & "") & "")...
  13. A

    Open a report

    Hi I have a list box which contains different types of log entries. Each different log entry type has a different report that goes with it. What I want to do is select an entry in the list box, and click on print, email, pdf or view report buttons, and the appropriate happens, selecting the...
  14. A

    Textbox Help

    adding the .text worked a treat. Many thanks
  15. A

    Textbox Help

    I have a textbox on a form, in which I enter a serial number of a product to open the relating form. All works well when typed in a button pressed. What I want to be able to do is scan the barcode on the product, this will then enter the serial number in the textbox and open the form. The...
  16. A

    Sample code for sending email

    Dim outlookapp As Outlook.Application Dim outlookemail As Outlook.MailItem Set outlookapp = CreateObject("outlook.application") Set outlookemail = outlookapp.CreateItem(olMailItem) With outlookemail .To = .Subject = .Body = .Send or .Display End with To add a hyperlink, you...
  17. A

    DAO Help

    That's got it thanks. As I want to carry on and do some other things after this, if I do the rs1.MoveLast to get the count, then rs1.MoveFirst and carry on, that would work as it has been?
  18. A

    DAO Help

    I am having trouble with the below returning the correct number of records, and can't see why. I have one table, tblDevice, which has 4 columns, ID | DeviceRecNo | ExcludeFromCheck | StockLocationID ID - Autonumber DeviceRecNo - Number ExcludeFromCheck - Number (1 = yes, 0 - No)...
  19. A

    Varaiable

    Thanks guys got it working as I wanted now. The code was a direct copy and paste I have to say, but I will be going through once I have things working and tidying up and making sure the comments are good and right. The design is a nightmare to work with, the names along are confusing as...
  20. A

    Varaiable

    The structure will be changing the next few months, its a load of rubbish and needs rebuilding.... Something we inherited, its not by design. :) I have a list of serial numbers for meters, which are in a meter table, which are assigned to sites. What I need to do, is check that the serial...
Back
Top Bottom