Search results

  1. M

    Schedule job to selectively pick DBs in a Folder to compact/repair them

    Do you know of the 'Compact on Close' option that does automatically?
  2. M

    Uneditable textbox

    Solved: Uneditable textbox Hi all I have a form that when opened will either allow new records to be added, or allow existing records to be viewed, depending on the OpenArgs. When existing records are being viewed, the user can click an 'Edit' button to allow that record to be edited. In add...
  3. M

    RecordSet and number of records returned

    Thanks for that Mark. Wow, I'm sure I've used GetRows() previously to return the whole query. Saw your post and thought it was coz I'd forgotten the brackets, but even that is only returning one record. Looks like I got a job of trawling through old code to check whether my GetRows() are...
  4. M

    Database question, please help me

    I'd give tblPetrolMoney and tblLoanMoney a go. Treat the Loan and Petrol allocations as different things, and only add or subtract them when you get to presenting data hth mcalex
  5. M

    RecordSet and number of records returned

    Hi all I am trying to code a duplicate remover that allows the user to check that the two records really do refer to the same person before hitting the big red delete button. I have this code: sql = "SELECT Caller.GivenNames, Organisation.OrgName, Caller.Phone " _ & "FROM Caller LEFT...
  6. M

    Syntax error in query expression 'SELECT update_mailer_step_two.id FROM...

    Okies, that requires a rethink If you can get the data you want into a query, then you can insert the contents of the query thusly: INSERT INTO tblTarget (Column1, Column2, Column3) SELECT * FROM (<<Your Select Query>>) where <<Your Select Query>> is the query that returns the data you...
  7. M

    Syntax error in query expression 'SELECT update_mailer_step_two.id FROM...

    I didn't know about docmd.runsql - will have to check it out. I use QueryDef.Execute You are on the right track, but you need to run the SELECT queries then the INSERT query. Something like: dim db as DAO.Database, qdf as DAO.QueryDef, rst as DAO.RecordSet Dim CFF_ID As Long Dim...
  8. M

    How to take a chain of data, convert it into rows (vertical instead of horizontal)

    Sounds like you've already got crosstab'd data. If your column list isn't too long, excel might be the quickest way to get your data into a 1 table, 2 column format. Export your current table to an excel spreadsheet and sort it so the most replaced part (the one with the most alternates) is...
  9. M

    Combining / merging tables and summing records

    Try this query: SELECT Fish.ID, Min(Fish.FishedState) AS MinOfFishedState, Min(Fish.FishedOtherState) AS MinOfFishedOtherState, Sum(Fish.DaysFished) AS SumOfDaysFished FROM Fish GROUP BY Fish.ID; hth mcalex
  10. M

    Syntax error in query expression 'SELECT update_mailer_step_two.id FROM...

    To reduce the complexity a bit, perhaps you could try getting the data into variables and then updating the data in a separate query eg setup CFF_ID and MS_ID variables, then run queries such that: CFF_ID = SELECT update_mailer_step_two.id FROM update_mailer_step_two MS_ID = SELECT...
  11. M

    nested joins to update one table based on the comparison between two other tables

    Ok, I'm not sure then. The only suggestion I would make is to rip out the 'AS m' from the select line, and all the 'm.' from the set lines. You can only update one table at a time, so they _shouldn't_ be needed. You may have to post a copy of the database for some of the experts/ gurus here...
  12. M

    Write conflict - This record has been changed by another user ...

    Hi guys, cheers for the discussion. Very educational. I'm glad there are different, acceptable methods for this sort of thing. Have gone with RG's suggested SaveRecord public variable at Form_BeforeUpdate(). Not having a MS background, I'm used to doing it all myself (with sql & connections...
  13. M

    nested joins to update one table based on the comparison between two other tables

    A where clause to only change the record that the user is working with. Something along the lines of: where m.mailer_id = <the id of the record> at the end of the sql. hth mcalex
  14. M

    nested joins to update one table based on the comparison between two other tables

    try: update ... set m.mailer_states_id = [user input], m.created_at = Time.now(), m.contacts_first_filter_id = contacts_first_filer.id; you may also want a where clause hth mcalex
  15. M

    Write conflict - This record has been changed by another user ...

    err, it is a query bound form. I open the form with a query that takes includes a where clause from the id of the record being viewed on the form with the edit button. When the user hits save, another query updates the table with the new values from the editable controls (I don't check to see...
  16. M

    Write conflict - This record has been changed by another user ...

    [Solved] - Write conflict - This record has been changed by another user ... Hi all I've got a form that shows existing records. The user clicks a button which opens a form allowing the shown record to be edited. When changes have been made, the user clicks save, which saves the data and...
  17. M

    How to save master and detail at same time?

    Ok, might give it a look. My form is a bit complex (drags in data from a bunch of tables to create the new record), so I may end up sticking with the Insert, then Select approach cheers MStef and vbaInet :) mcalex
  18. M

    How to save master and detail at same time?

    @vbalnet: yep, which is the problem, coz I don't have that ID until savetime.
  19. M

    How to save master and detail at same time?

    Hi I have a form that collects (contact logging) data that will be saved to two different tables. Up to now, I have been saving the master info, and then querying the table (using the data I just saved) to retrieve the primary key in order to correctly save the detail, but it strikes me that...
  20. M

    Query by Combo Box / Query by Form Controls

    @mafhobb In the Criteria cell of the query window, add "OR IS NULL" without quotes, after whatever other condition you are querying for.
Back
Top Bottom