Search results

  1. simongallop

    using variable name in lookup

    Try this: DealerPrice = DLookup("[RollCost]", "Products", "[Product Name] = cmbProdName And [RollSize] = '" & CStr(SizeHdr) & "'") Strings are usualy held in single quotes numbers no quotes HTH
  2. simongallop

    passing a database password to 'opendatabase' statement

    Dim WrkJet as Workspace Dim RepDB as Database Set WrkJet = CreateWorkspace("NewJetWorkspace", "admin", "", dbUseJet) Set RepDB = WrkJet.OpenDatabase("C:\MyFiles\MyDB.mdb", True, False,";PWD=MyPass") HTH
  3. simongallop

    Code to modify query

    Think that we are all confused here! Looking through this post I have come up with the following possible scenarios. Which, if any, are you trying to use? For all of the scenarios a user selects an item from a combo box eg "CARS" 1/ You want the query to return all records which have CARS...
  4. simongallop

    excel problem

    Where are you sending the emails from. Are they normal emails where you manually attach your excel spreadsheet? Or are they created by Access and you are attaching an exported table/query?
  5. simongallop

    Writing recordset/Array value to report

    From recordset (rstTest) to a textbox (txtItem1) Form![MyFormName]![txtItem1] = rstTest("FieldName")
  6. simongallop

    SQL Statement - Requery

    CurrentDB is a reserved word in VBA. Also think that it will fall at Set QDF = CurrentDB.QueryDefs(TempQuery). If TempQuery exists then it should be in double quotes ie ...("TempQuery"). If TempQuery does not exist then you will need to create it. Look at the CreateQueryDef in help HTH
  7. simongallop

    Module Error

    Having carried out the changes in my previous comment the commission query works fine! To do the changes: 1/ Go into relationships and delete the 4 links between the tables INDIVIDUAL POLICY HOLDERS and PRODUCTS COMPLETE 2/ Go into design view of PRODUCTS COMPLETE 3/ Change the field type...
  8. simongallop

    Module Error

    I have 2000 post 2000 version of your db
  9. simongallop

    Module Error

    Don't want to be rude but I said check your field types: In query Commission you have a join between [Individual Policy Holders].[Unit Number] and [Products Complete].[Units] The first is a text field the other is numeric. That is an example of joining with the wrong data type.
  10. simongallop

    VBA Code (New to VBA)

    I might be wrong but I think that if you have a form open showing data from a link file then the file is locked and cannot be updated by another source. So far that seems to be the case having tested it on Excel and also on dbf created by Monarch (not MS product). You will need to test this...
  11. simongallop

    Module Error

    That message usualy means: In a query that you are trying to link a string field with a numeric field. In VBA that you are trying to carry out numeric calculations on a string or something similar. Check the declared types of the fields in the underlying tables and make sure that they match...
  12. simongallop

    Searching For Specific Characters

    Look at the LIKE operator in help Trailing spaces can be removed by TRIM Mid spaces would have to be done by a combination of Find and mis / instr / left built into a function.
  13. simongallop

    Auto fill fields from table

    Am getting a bit confused. If you want, send me the db and will have a look
  14. simongallop

    select the last 12 months worth of data

    If the date that is from the form is the starting date of the year that you want then how about: WHERE Mad.DateField>=[Forms]![INPUT COMPARISON]![DATE FIELD] And Mad.DateField < DateAdd("yyyy",1,Forms]![INPUT COMPARISON]![DATE FIELD]) HTH
  15. simongallop

    Module Error

    In which case use this function and slowly start to build it up to what you want. One thing that you might want to be wary of is that I think that InputBox returns a string so you might need to convert it ie Val(InputBox(...etc))
  16. simongallop

    Module Error

    To get a better idea of where it is going wrong: Open a new module sheet and call it TEST_FN Type in the following: Function RetNum(MyNum) RetNum = MyNum End Function Now create a query and use data from a small table with a numeric field and create two fields TestField: RetNum([FieldName])...
  17. simongallop

    Module Error

    Have you tried removing the As Doubls and hav it undeclared ie: Function CalCom(priceEV) If you are worried about it being a number then force later on in the code to make sure that it is a number. HTH
  18. simongallop

    IIF statements

    My question was to see if the following is true: Broker: Number (ie25) Broker / Marketer: Broker Num followed by '/' followed by Marketer Num ie(25/14) IF that is the case then: IIf(InStr([Field where above data is stored],"/") >0, "Marketer exists", "No / so therefore only broker exists") HTH
  19. simongallop

    Scolling mouse wheel and VB code

    I had the same prob then discovered that the intelli mouse can be plugged in like a normal mouse, where it usually but not always works, or you can load up the software for it and theoretically it works but has a tendency to crash!! Take your pick:)
  20. simongallop

    IIF statements

    First an Iif statement is made up of 3 parts. Iif(Bit under test, action if True, action if False) In your example where you have = Broker it is then followed by 4 bits rather than 2. It won't work! Second date: Many ways of doing this! Here is one: Iif(Format([Individual Policy...
Back
Top Bottom