Recent content by phatnq2002

  1. P

    Default field content based on different table

    I think, to do this, you can make some codes in the Consignment_AfterUpdate event procedure: If [Consignment Size] > 20 Then MaxPasses = 4 ElseIf ... ... End If And, the Form_Current: If [Consignment Size] > 20 Then MaxPasses.DefaultValue = 4 ElseIf ... ... End If
  2. P

    Compile error: Else without If

    Dear tho28199 If txtCheck.Value = "A" Then _ lblTitle.Caption = "Amended Entries Completed - Change Flag Form" You use the character _ after Then, it says that the statement behind is an element of the If, but break to new line. So the translator do it like an only statement. The error occurs...
  3. P

    Saving forms with stored procedures?

    In Access, we can make a project file which connect to a SQL Server. So we can inhirit all features of SQL Server. When using project file, we can run a store procedure by: CurrentProject.Connection.Execute "EXEC storeprocedure" or any action query: CurrentProject.Connection.Execute...
  4. P

    Need help with Query

    This make a form has name of pupil, word content instead of their ID numbers.
  5. P

    Row selection

    You should use the Conditional Formatting to change the background of the controls in the Detail section (but command button). In the table, you add a Yes/No field (named selected or else), default value: 0 In form, add a checkbox (name: selected, control source: selected), select all textboxes...
  6. P

    Says query is too complex.

    Dont get a table directly to use as a Source Object of a subform. You make a form (named frmSearchResults or else) that has a RecordSource - query2 (Default View: Datasheet, Allow Additions: No, ...) In formNz, change the Source Object to frmSearchResults. In code, remove...
  7. P

    Open filtered report from unbound form command button

    The easy way: First, modified the current code: On Error Resume Next DoCmd.OpenReport "rptCurrentAll", acViewPreView,, "Section = '" & txtFilter.Value & "'" On Error Goto 0 Second, in the Report_NoData event procedure of the report, you put this code: MsgBox "No record. Report will be closed."...
  8. P

    Says query is too complex.

    Check to be sured the fieldnames are correct. The SearchResults form and the FormNz form are yours. I only edit something. Can you send me your newest file?
  9. P

    Says query is too complex.

    Here is my work. (see file attached) Hope this helpful for you.
  10. P

    Count records to page header

    Try to do this way (I'm not sured): In class module of report, you declare a variable named cnt: Dim cnt As Integer In Detail_Print event procedure, you put this: cnt = cnt + 1 In PageHearderSection_Print or PageFooterSection_Print base on you want to show the count of records per page, you...
  11. P

    Need help with Query

    OK, I know what you want. But, I think you should re-structure your database. We need three tables: Table 1: Sessions SessionID, PupilName, Marks Field Marks is the total correct answers the a test session Table 2: Tests SessionID, WordID, PupilAnswer Table 3: Word Answers WordID, EnglishWord...
  12. P

    Conditional format of record lines in a list box

    You use a form to do this instead of a list box, because in form, you can use a conditional formatting for each record. I dont know that the old day is the same row with the day logged, you can say it clearly, OK?
  13. P

    Simplify calculation

    That form has a recordsource? and the [txt...Calc] have their controlsource? If right, you can make a query, then use it as the form's recordsource. In the query you make a calculate field likes above. In contrast, you set the default value of each in [txt...Calc] to 0. So you can rewrite...
  14. P

    Form Combo Boxes

    When you change the price of the contract, you need the price has updated to the other table, too. Is this right? To do this, you can write some code for the Form_AfterUpdate event procedure. For example: CurrentDB.Execute "UPDATE tblStoreTable SET Price = " & [txtPrice] & " WHERE CustomerID = "...
  15. P

    Changing Report query parameters in code before running Report

    Report has an event property named On Open. This occurs when report is called but not be loaded (so not be shown). You can change the report RecordSource propery in the Report_Open event procedure. For example: If callForm = "Form1" Then RecordSource = "query1" ElseIf callForm = "Form2" Then...
Back
Top Bottom