Search results

  1. Ken Sheridan

    Setting Recordsource when there are two or more forms open

    That's a good approach, especially if the second form's recordset is restricted by parameters referencing the calling form. Provided that the referenced controls in each of the possible calling forms have the same names, the second form's RecordSource can easily be built in its Open event...
  2. Ken Sheridan

    Setting Recordsource when there are two or more forms open

    I would recommend using the OpenArgs mechanism as Gasman suggests. The following is code in an unbound form's module which builds the SQL statement for a query and passes it to a form as the OpenArgs argument of the OpenForm method: Dim strSQL As String Dim strWhere As String...
  3. Ken Sheridan

    SQL problem

    Because you provided no context to your original question. Consequently we were only able to deal with your issue at face value, which clearly pointed to an inappropriate course of action. If you'd taken the trouble to explain the background in the first place, then a lot of wasted time would...
  4. Ken Sheridan

    SQL problem

    The original question was answered in post #2.
  5. Ken Sheridan

    SQL problem

    The column names in the table you have posted differ from those in your code. If the Boxes table has the same columns as the table you've posted you'd have to change a query to the following, though I've had to guess what column names to use where they differ from those in your code: SELECT...
  6. Ken Sheridan

    OutputTo Excel error

    You could add the following line to the code: CurrentDb.QueryDefs.Delete "qryTemp" But, as Tom has said, it can be handy to have an object you can amend whenever you want a temporary query.
  7. Ken Sheridan

    I'm sure there is a simple solution asset tracking MY NEW PROJECT.

    It's important to remember that, in a relational database there are two types of tables, base tables and the result tables of queries. It's also important to understand that a fundamental principle of the database relational model is the Information Principle (Codd's Rule #1). This requires...
  8. Ken Sheridan

    I'm sure there is a simple solution asset tracking MY NEW PROJECT.

    There is no Assemblies table, only the Parts and PartStructure tables. The former contains all 'parts' i.e the complete assembly, all sub-assemblies and all atomic base parts. PartStructure models a binary many to many relationship type between two instances of the parts table: The...
  9. Ken Sheridan

    Recommendations on appending or linking historical data into a new dataset

    You can easily restrict the rows inserted into the local table by restricting the INSERT INTO statement by means of the NOT EXISTS predicate, so there would be no need to specify dates. This is more reliable that relying on the dates as it would also insert any rows with dates prior to the...
  10. Ken Sheridan

    I'm sure there is a simple solution asset tracking MY NEW PROJECT.

    Which is exactly what my BoM file does. I first built it around 25 years ago using one of the standard algorithms published by Chris Date in the Introduction to Database Systems, but having generated the BoM I wanted to aggregate the weights of the atomic base parts which made up the...
  11. Ken Sheridan

    I'm sure there is a simple solution asset tracking MY NEW PROJECT.

    If we start with a table Parts with columns for it's attributes, each of which must be functionally determined solely by the key: Parts ....PartID (PK) ....PartName ....Tag Parts are combined to make assemblies, which is another entity type modelled by a table: Assemblies ....AssemblyID...
  12. Ken Sheridan

    DLAST FOR DATE SERIAL

    This can also be done without the need for a CurrentEntry query to return the latest row. The requirement is analogous to the very common task of reading from instrumentation, where the current and previous readings are returned in order to compute the consumption between readings. The...
  13. Ken Sheridan

    Continuous form scrolls to top. Can I prevent this?

    That filters the form to the one record. Rather than doing that, open the form and then navigate to the record: Const MESSAGE_TEXT = "No matching record found." Dim frm As Form Dim intJobNumber As Integer intJobNumber = Me.txtJobID DoCmd.OpenForm "frmTodayNew", acNormal...
  14. Ken Sheridan

    Form with subform in transaction

    The fault is probably mine.
  15. Ken Sheridan

    Continuous form scrolls to top. Can I prevent this?

    Take a look at the option to use a simulated split form in the attached little demo file. If you use this as a model for what you are doing you should have no problems.
  16. Ken Sheridan

    DLAST FOR DATE SERIAL

    I think that's true. As far as I can see the entry_date column includes the time of day, so the first thing to do is ensure that, in table design view the column is indexed uniquely (no duplicates). You then don't need a date_time_stamp column. If you've set its DefaultValue property to...
  17. Ken Sheridan

    Continuous form scrolls to top. Can I prevent this?

    You'll need to put code in the subform's AfterInsert event procedure to requery the parent form and move to the newly inserted record. The following is code from one of my demo files which does this: Private Sub Form_AfterInsert() ' requery parent form to include new record ' and...
  18. Ken Sheridan

    DLAST FOR DATE SERIAL

    I would not rely on an autonumber column to indicate the sequence of insertion of rows into the table. As you've pointed out this would fall down if the rows are not inserted in entry_date order. The value cannot be manually corrected as autonumbers cannot be edited. Instead I'd suggest you...
  19. Ken Sheridan

    Entering text into a table via a query

    So how do you determine the distribution of the payments among the six outstanding invoices? If you give priority by invoice date for instance, and the payment covers three with a remainder, then how do you indicate that the fourth invoice is partially paid?
  20. Ken Sheridan

    Form with subform in transaction

    Firstly let me make clear that in the context of a many to many relationship type my view is that a parent form/subform will in most cases be the appropriate interface. This is not a matter of necessity, however. Separate 'linked' forms can equally well be used if preferred. The referencing...
Back
Top Bottom