Search results

  1. D

    Hyperlink

    I have my user select a file from a file selection dialog. I then want to add a hyperlink into a table hyperlink field pointing to the file they chose. Probelm is, i don't want the displayed text of the link to be the full path (due to length issues). Obviously the 'Address' will be the full...
  2. D

    Reading subform field

    Probably really simple... but: I have a main form with a command button on it. Also on the main form is a child form driven by a query, shown as a table. One of the fields shown from this query is 'ID'. How do I get the ID of the currently selected record (that the user has clicked on in the...
  3. D

    Message text

    I have required fields on my form. If the user doesn't enter all values they get the unhelpful "The field xxx cannot contain a Null value because..." which is correct, but I'd like to give a more meaningful message. Can this be done?
  4. D

    More commitment!

    I run three insert queries to populate the tables in my db - code below. If I run through line by line using F8 then no problem, but if I let the code go at full speed sometimes (most of the time) the final statement fails. I reckon this is because of the relationships and trying to execute the...
  5. D

    Simple union query issue

    The answer to this must be simple, but highlights my lack of knowledge of union queries - help guys! I have a table with two price lists in it, say 2007 and 2008 price lists. I have two queries (for simpicity) that pull the data into seperate entities, one for each price list. I want to compare...
  6. D

    Dlookup and Null

    I am pulling values from a table in a loop and there are occasions when th ereturned value is null, which errors because, I believe, I cannot assing null to a variable. Is there a better way to code this or do I really have to check each one with 'If Isnull(...'
  7. D

    Execute Append Query?

    Can someoone tell me what I'm missing here? Its gonna be something daft I know... The append query just adds data to a table incrementing by weeknumber. The error I get is '3061: Too few parameters...' as it tries to run the line 'qd.Execute'. Dim SWk%, EWk%, i% Dim qd As DAO.QueryDef...
  8. D

    'Select' parameter query help

    I need to passa parameter to a select query that shows info on a subform. I understand that I cannot execute a select query, such as qry.Parameters![ONo] = OrdNo so what is the alternative? How do I do this?
  9. D

    Commit record?

    I run the following code when the user executes a certain event (it records the time an email was sent): SQL = "UPDATE tbl_RMAs SET [FourHour] = '" & Now() & "' WHERE [RMANo] = '" & Me.RMANo.Value & "';" CurrentDb.Execute SQL All is ok until I exit the form. I then get told that the record has...
  10. D

    Delete QueryDef?

    Simple one this maybe! I use the following which works fine: CurrentDb.QueryDefs.Delete "qryTemp" ...but only if "qryTemp" exists of course. I can't guarantee it always will so i'm looking for kind of IfExists("qryTemp") does such exist?
  11. D

    Optional Paramater

    Can someone point me in the right direction regarding optional parameters in a saved query? My query is based on a form with combo boxed that the user may or may not select from. I say saved because i'm using: Me.cldTemp.SourceObject = "Query.qry_ByDept" where cldTemp is a subform on a form. The...
  12. D

    Union?

    I have a union query that is not combining correctly. i.e. it is returning all the values from the first part followed by the results of the second. I really wanted them combined on the same row where appropriate - any ideas? SELECT Yr, Mth, CNo, Customer, AON, AOC,Null as CON,Null as COC FROM...
  13. D

    Too few parameters??

    :confused: I have an append query that is called thus: CurrentDb.Execute "_qry_PopulateTableUnionTemp" It used to work fine, no problems, but I have made some minor changes to my db and now the code fails on this line with the message "runtime error 3061: Too few parameters Expected 2". What I...
  14. D

    This should be simple (marge 2 queries)

    I have one query that returns a list of all debits in a given year/month/cost element: e.g. Year Month CE Debit 2007 6 111 100.00 2007 6 153 150.00 2007 6 157 2007 6 294 75.00 and another that returns a list of cost element budgets: e.g. Year Month...
  15. D

    Export to excel - Simple?

    I have used this loads of times before but not with a subform on a report. My code says: DoCmd.OutputTo acOutputForm, "frmDetail", acFormatXLS, , True where frmDetail is the subform on frm_Main (but not linked to frm_Main - i.e. for display only). So then I try: DoCmd.OutputTo...
  16. D

    Supress 'Printing...' dialog

    Have searched the forum but not really found a solution - anyone any new ideas? I'm printing multiple reports in a loop using: DoCmd.OutputTo _ acOutputReport, "rpt_SOAs", acFormatSNP, SPath, False and want to stop the 'printing...' dialog popping up for every run. It doesn't pose a real...
  17. D

    Simple(!) grouping

    I need to split my report into groupls of departments (4 digit strings) thus: <1599 1600-1849 >1849 ..but don't seem to be able to get it right. I'm using: =IIf(Val([CESE])<1600,"","Payroll") =IIf(Val([CESE])>1849,"","Overhead") in the Field/Expression dialog (sorting ascending) but this aint...
  18. D

    Run query without prompts

    (Sorry - posted to wrong forum earlier) Normally I would run a query like using 'CurrentDb.Execute' so that no user prompt occurs, but how do I avoid prompts when I need to run an update query?. I'm using DoCmd.OpenQuery "qry_UpdatePW" with no joy!
  19. D

    Run query without prompt

    Normally I would run a query like using 'CurrentDb.Execute' so that no user prompt occurs, but how do I avoid prompts when I need to run an update query?. I'm using DoCmd.OpenQuery "qry_UpdatePW" with no joy!
  20. D

    Simple Default Value

    I have a query that looks at all budgets and returns the spends against each. Occasionally I have a budget value but no spend against it so the spend column is blank (null). I want this to show zero in such cases rather than blank but cannot figure out how to do this. Any ideas?
Top Bottom