Search results

  1. B

    Getting the current month with code

    I can get the current date with this: Dim dtDate As Date dtDate = Format(Date, "mm/dd/yy") Is there a constant for months? I mean is there I way I can convert this code to the month at the time the code is run? I have a report that I want to filter by the current month. So if the code was run...
  2. B

    Copying records with vb

    You could do it by grabbing, copying and then pasting a recordset from one table to another. This should get you started. Topic: Using RecordSet to update table? In that example I am using static data but it could be modified pretty easily to accomplish your goal.
  3. B

    how do i make a report to just show between two dates?

    Here is a example of doing it with code using two text boxes and a command button. Private Sub cmdSelect_Click() ' Create two text boxes on your form, one named txtBeginDate ' and the other one txtEndDate Dim bProcOk As Boolean bProcOk = True ' The following IF Then...
  4. B

    Email from Access 2000

    I think this is the default for Outlook 2000 when you install one of the latest service releases for it. There is a work around for it but I can not seem to find it right now. Try the KB database.
  5. B

    update database from a website form

    You can actually do it either way but I like to keep my scripts separate from my HTML. You can do that by naming the script in your form code like this. <form method="POST" action="script_name.asp"> The script that handles the code would be named script_name.asp in this example. Also keep in...
  6. B

    update database from a website form

    karendiane, Does it have to wait until the end of the day to be emailed to you. If not you can add it to the database and get the email at the same time. Here is just a little demo code for that so you can see the syntax. <%@ Language="VBScript" %> <% Option Explicit %> <% Dim msg, mailer...
  7. B

    macro to new record wont work

    Are you sure the correct event is being used for the trigger?
  8. B

    Help with a DCount

    Thanks Dembrey and Alex it works now. For any one who is interested this is how it turned out. If Not IsNull(DLookup("[Jobnumber]", "CloseOutData", "([JobNumber]= '" _ & Me!JobNumber & "') And ([SalesYear]= '" _ & Me!SalesYear & "')")) Then intQuestion =...
  9. B

    Help with a DCount

    Alex, SalesYear is a text field so how should I adjust the quote mark's position? I tried placing them where I thought it made sense but recieved an error each time.
  10. B

    Help with a DCount

    Ok I am lost now. I am trying to check and see if the job number exists with the same sales year. So if: X > X and Y > Y then a record was found. But if: X < X and Y < Y then no record was found Thinking about it a little more I bet I should be using => because I am missing any that = 1...
  11. B

    Help with a DCount

    Thanks Dembrey, I am closer now but I am still have a problem somewhere. Look at this block of code: If DCount("[Jobnumber]", "CloseOutData", "[JobNumber]= '" & _ Me!JobNumber & "' > 1 And [SalesYear]= '" & _ Me!SalesYear & "'") > 1 Then MsgBox ("A match found")...
  12. B

    Folders, Paths, Files

    This should get you started: Topic: Count files in a dir Topic: List files on subdirectories Topic: How do I Delete a Directory Topic: Browse drive for files Topic: Moving files in code I realize that not all these apply directly to your question but I think you will be able to mine most of...
  13. B

    Help with a DCount

    Can some one tell me what I am doing wrong in this Dcount? If DCount("[Jobnumber]", "CloseOutData", "[JobNumber]= '" _ & Me!JobNumber & "'" > 1 And Me!SalesYear & "'") > 1 Then I am getting a type mismatch error, both fields are text fields. [This message has been edited by...
  14. B

    Macro to create a duplicate record

    You can use a SetValue to this in a macro. For instance if you want to bring the LastName filed from the current record to the new record you would do it like this. You can do as many SetValues as you want in one macro. I would encourage you to do this in code instead of macros like this...
  15. B

    Mask HTML code on the form

    Why not do your HTML formatting in the ASP page? Have you tried formatting it inside an Access Query and then connecting the ASP page to the query? I have never tried it but I think it would work. For instance you have a field named FirstName you could write the query like this. webFirstName...
  16. B

    Liking a checkbox to lock down a subform.

    This should work for you: Private Sub chkMyCheckBox_Click() If chkMyCheckBox = True Then frmFormName.Enabled = True Else frmFormName.Enabled = False End If End Sub
  17. B

    Get and print database name on report

    Rod C, you should find your answer in this thread: Topic: Current Path Post back if you have more questions about it.
  18. B

    Dummy VB trying DoCmd.Transfer Databse

    Rich I forgot to add an imput box to the code I posted above. You could do it something like this: Dim strFileName As String Dim strName As String strFileName = InputBox("Enter a file name") strName = "FileName" & strFileName
  19. B

    Report if True?

    Something like this should work for you: DoCmd.OpenReport "ReportName", acViewPreview, , _ "[IsTrue] =" & True Replace the IsTrue with the field name you are using for the check box and your report will open showing the only the true fields.
  20. B

    Special condition in a if

    I think the Dcount is what you are looking for. The syntax is similar to a Dlookup. Here is an example. If DCount("[JobNumber]", "TimeGR", "[JobNumber]= '" _ & strInput & "'") = 0 Then ' Do something here .... If DCount("[FieldName]", "TableName", "[FieldName]= '" & Criteria & "'") >...
Back
Top Bottom