Search results

  1. C

    Calling a Function from VBA Code

    OK, this is driving me nuts. I have a simple function I want to call from a VBA module. Below is the code: Public Sub CGDTest() Dim LowPct As Double, LowDeduct As Double LowPct = 15.9 LowDeduct = CalcLowDeduct(LowPct) End Sub Function CalcLowDeduct(LowPct As Double) LowDeduct...
  2. C

    Can't Update Form Control Using DLookup

    I've uploaded a database which is giving me trouble. It was a template someone downloaded and asked me to tweak. The form named Order Details Subform has a combo box control named ProductID. (I would have named it cboProductID, but oh well . . . ) Anyhoo, when I run the main form or the...
  3. C

    One More Report Filtering Question

    OK, so I added another filter to the reporting sub: DoCmd.OpenReport ("AllSamplesReport"), acViewPreview, , "[pvmt_analysis_section_id] = " & Me.cboSectionNo " and [pvmt_sample_nmbr] = " & Me.cboSampleNo pvmt_analysis_section_id and pvmt_sample_nmbr are integers. I keep getting syntax...
  4. C

    Help with VBA Report Filtering Syntax

    I have the following procedure to filter a report. Private Sub cmdCreateReport_Click() ' The section and sample numbers were chosen by the combo boxes DoCmd.OpenReport "SampleReport", acViewPreview, , [pvmt_analysis_section_id] = '& Me.cboSectionNo &' " End Sub The variable...
  5. C

    Running a VBA Module from a Macro

    How do you run a VBA module from a macro? I tried the OpenModule action, but all it did was to open the module. I had thought this would run it since OpenQuery runs the query, not just opens it. Any help would be appreciated.
  6. C

    At Wit's End with Recordset

    I've uploaded a database attached here called PMBooks1. It coughs and spits at the line: Set rstRehab = myDb.OpenRecordset(rehabQuery) I get an error message to the effect that VBA "expected parameters," but evidently was disappointed. I know that the SQL is valid because I tested it in...
  7. C

    SetWarning action line gone from Access 2007

    I've done macros before in 2003 where I run queries and do SetWarnings to Off. But I can't seem to find this action in 2007. Does it go by another name now? Thanks.
  8. C

    Can you nest a recordset within another recordset?

    I tried to run the code below, but got an error saying that I was not providing a required parameter, on the line marked in red--it runs fine up to that point. I'm trying to nest looping through one recordset within another (sections with projects on them, an expansion of the simple recordset...
  9. C

    Simple Recordset Won't Work--Please Help

    Since my previous attempt (posted in a previous thread with no response) didn't work, I decided to punt and simplify things a bit. So I wrote a routine that merely opens a recordset of section numbers, loops through them, and prints the section number in the debug window. The program runs...
  10. C

    Assigning Record Number/Recordset Doesn't Work

    Below is the code I wrote after looking at a book. I know, I know, but it's all I have since no Access gurus live nearby. What I'm trying to do is to loop through a recordset of unique pavement sections, then get the overlay/rehab table (rehab_proj_join), of course many projects to one...
  11. C

    Record Number Function/Old FoxPro User

    I'm trying to convert some Visual FoxPro applications to Access/VBA, and I find that I'm spoiled to some of the old xbase code. For example, VFP has a recno() function. I realize that Access does not have this for practical reasons, but unfortunately, I still need it. My data sitch is this...
  12. C

    Combo Boxes, Filtering, and Requerying

    Hello--I'd like to request your help. I've created a form where I use combo boxes to narrow down user choices. The combo boxes have an SQL statement for a RowSource, and this works well. However, I can't get the the record pointer off the first record and filter them down to the criteria...
Back
Top Bottom