Tables and forms and macros oh my!

cmf2112

New member
Local time
Today, 15:43
Joined
May 18, 2007
Messages
7
Hello everyone! I’m new at building databases; actually, I’m learning as I go as I’ve never had any formal training and this is my first significant attempt. So with that said, I’m hoping someone out there may be able to help me and I apologize in advance for how long this is. A little back round—I’m writing a database to create a report showing the loan history on an account—basically it shows how many loan payments came in with the dates they were processed and amounts of each payment. I created a table that is supposed to populate after entering the policy number, original loan amount and original loan date into a form. I have a macro that when a button is pushed on the form, should run a query (this query is made up of the table I created as well as tables from our data warehouse and when ran, gets the loan payments, dates processed, amounts, etc), opens a report in print preview (showing this loan info), and then deletes the record from the table that I created via a delete query (I do not want a history of each policy number that is entered into the form). Now to the issues—when I enter the info into the form, it does not automatically populate the table that I created, therefore the report does not show any loan data and obviously the delete query would not work. If I move to the next blank record, the table does populate with the info I just entered in the previous record, the report runs, but the delete query still does not work. I’m not understanding why my table won’t populate right away—the record source on the form is my table. I assume the delete query not working could have something to do with my macro? Here is how I have my macro set up:

Action: Echo Action Arguments: (Echo On) No (Status Bar Text) blank

Action: SelectObject Action Arguments: (Object Type) Query (Object Name) qryFormInfo (In Database Window) Yes

Action: OpenReport Action Arguments: (Report Name) rptFormInfo (View) Print Preview (Filter Name) blank (Where Condition) blank (Window Mode) Normal

Action: SelectObject Action Arguments: (Object Type) Query (Object Name) qryDeleteRecord (In Database Window) Yes

Action: Echo Action Arguments: (Echo On) Yes (Status Bar Text) blank

So if any of you made it this far, can anyone see anything obvious that I have wrong? Just a warning—I’m not good with VB code. I appreciate any input/suggestions you may have.

Thanks for your help!
 
What is the point of the table you created? Typically you would not need that. Your query would only reference the main data table, and you'd add a criteria to restrict the records returned to the record on the form (and/or date range, etc). In design view, in the appropriate column, it would look like:

Forms!FormName.ControlName
 

Users who are viewing this thread

Back
Top Bottom