Search results

  1. J

    Another OpenRecordSet problem

    Pete It is standard practice to have a recordset based on a query. Typically strSQL= "SELECT * FROM some_table WHERE field=something" set rst=db.openrecordset(strSQL) suggest you search the forum where there will be lots of examples or check out any Access VBA textbook
  2. J

    Best Post Code Validation?

    On a more helpful note and assuming that you are using UK postcodes the following will work when set as the input mask of the relavent field L?09? 0>LL this will cover the following W1 2AB LA22 6TZ WC1X 4FG If you are looking at Germany much more straightforward 00000 eg 85551 The help...
  3. J

    Re: email with criteria?

    Below is a line I used recently which worked fine DoCmd.SendObject acSendReport, , acFormatSNP, "xyz@easynet.co.uk", , , "Invoice", strMailText, False I have also spotted a mistake in the code should be Do While Not rstRecipients.EOF As I suggested before the code was meant as general...
  4. J

    Re: email with criteria?

    Larry I would create a recordset for each enroller and then write a loop to send the mails. Something along the lines of dim dbs as DAO.database dim rstRecipients as DAO.recordset dim strSQL as string dim intEnroller as integer intEnroller = EnrollerID ' get this from some sort of input...
  5. J

    Re: email with criteria?

    A couple of thoughts spring to mind if the reciepients are fixed for each person then create a table with a one to many relationship so that each person entering reports has a list of recipients. Then open a recordset based on this and loop through sending a mail to each of the appropiate people...
  6. J

    Text boxes...

    Luke Have you tried using the full name rather than me! eg Forms!frmFormName!txtTextBox1.visible Does your text box names appear in the the left hand of the two list (object box ) boxes above the code window?
  7. J

    Addressing subform field in Where clause

    Andre If you do a search on this you will find lots of threads on this topic. An example from a recent project of mine is Forms!frmCreateInvoice!sfrmInvoiceDetail.Form!txtEngineerCode = strEngineerCode the .form after the subform name is vital the choice of "!" or "." is less so
  8. J

    Update table data with VBA

    Though of course the above only applies if you are using DAO
  9. J

    Update table data with VBA

    Not quite sure why your mixing DAO and ADO. You need to test the field values in the recordset not the recordset itself ie If rstCat.field("field_name") Like "*" & "DELL" & "*" Then rstCat.field("field_name")="DELL"
  10. J

    Emailing via access

    Bob There are lots of threads here on this subject if you search for them. Most common way is to use the "sendobject" method, check this out in the acces help files
  11. J

    OnClick SQL Select -> Compare -> SQL Update

    Michael Dont think you are going about this the right way. I would suggest that the dlookup funtion would be one possible way to go. Best place to start for info on using this is Access help or do a search of the forum. If you do go down this route be aware that dlookup does not work well when...
  12. J

    Sending multiple tables using sendobject

    Can you create a query which returns the contents of your 4 tables and send that?
  13. J

    Assign result of sql query to a variable... help plz

    @Superock 1. The round brackets are not needed but query builder puts them in. If you have a statement with and / or expressions they can be useful. 2. Access uses double quotes by default, however some versions of SQL will only use single quotes. Both work equally well inside access but there...
  14. J

    Assign result of sql query to a variable... help plz

    Sorry I should read more slowly. At least two possibilities one is to use the Dlookup function check out the VBA help for full details but should look similar to strCustomerName = Dlookup("[First name]","Customers","[Customer ID])=10") Dlookup can be problematic especially if there is more...
  15. J

    Assign result of sql query to a variable... help plz

    The answer depends on whether the field is a number or a string . Assuming [Customer ID] ( it is better practice not to have spaces in your field names so CustomerID or Customer_ID are prefered ) is a numeric data type the code would be "SELECT Customers.[First name] FROM Customers WHERE...
  16. J

    annoying problem!

    Krys Just checked the access help file and it suggests that in VBA SQL statements you must use US format dates although regional settings will work fine on the design grid.
  17. J

    annoying problem!

    Krys VBA should be aware of the regional sttings as specified in the users control panel, regional settings applet. Dates are stored by VBA as a floating point number where the integer represents the day and the decimal part the time (as a percentage). I believe that day 0 was Dec 30th 1899. So...
  18. J

    annoying problem!

    Krys Are there any records being returned by your query? In debug mode check the RecordCount property of the recordset in the Locals window.
  19. J

    VB for sending emails on click

    the code should be Private Sub Received_Request_Click() On Error GoTo Err_Received_Request_Click If [Received_Request] = True Then [Received_Date] = Date DoCmd.SendObject acSendNoObject, , , _ To:=Me.Technican, subject:="Update from Provisioning Department for Circuit " & Me.Primary_ID & "...
  20. J

    VB for sending emails on click

    Further thought just as I am shuting my machine down ( the pub is calling very loudly) unless the data type is set to variant you cant assign a null value to it. Normally you would only test for null eg if isnull(order_date) then .... etc not assign it as value because it isnt one.
Back
Top Bottom