Search results

  1. K

    Overwriting changes to a saved excel file

    In Access the SetWarnings commands would sort this out, but you are saving in Excel so you need to use the Excel command of DisplayAlerts. So within your With clause you need: .DisplayAlerts = False xlWB.SaveAs ("C:\Example\" & variablechange) xlWB.Close SaveChanges:=True .DislpayAlerts = True
  2. K

    Excel cell style references

    Yes it is possible. You need to open up the recordset/table, then you can loop through the fields by index number, from 0 to (Fields.Count-1). You reference the fields by number then. Eg: Dim Ctr as Byte, rs as Recordset Set rs=CurrentDb.Openrecordset("MyTable") For Ctr=0 to...
  3. K

    How do I calculate this? IIF dilema

    You need to do the sum in the same step for it not to just look at the first record, so in your report footer try: =Sum(Iif(LessonType=4,14,[Rate])) I've used 14 instead of 140 because presumably to add up correctly you need to split the 140 total over the 10 lessons (which each have...
  4. K

    DATEADD in VBA

    An SQL statement should always finish with a semi-colon (;), so first try putting one just before your last quote marks, see if that helps.
  5. K

    Drop Down, Question

    The way you've shown it, each country will only ever have one city. Is this true? Or do you want to just change the City dropdown to only show cities for the chosen country? For the first option, you can have the city as a second column (possibly hidden, ie column width=0) in the Country...
  6. K

    If Then statement help

    Alternatively... If IsNull(Me!Name) Then
  7. K

    hymnal and song db list box duplicate records

    Can you just do a Group By on the 3 fields in the recordsource query? Alternatively you need a query with SQL that starts with SELECT DISTINCTROW instead of just SELECT.
  8. K

    warehouse stock control

    For starters, I would strongly recommend that you design a Front-end/Back-end database, so all your data is stored in one file and all your forms and reports are stored in another. This helps protect your data while you add or change other items. Now I hate to do it, but I'm going to have to...
  9. K

    Using UnBound Column of a ComboBox in a Report

    You can simply have an identical combo box on the report which has the first column width=0 so that the second column shows. The dropdown arrow won't show except in design view. Alternatively, change the recordsource of your report so that your PanelDescriptions table is linked on the ID...
  10. K

    Formula Help

    I don't know what Crystal Reports 10 is (I'm still fairly new here), but it seems like you want something like: Iif([Fieldname] Like "*xyz*", True, False) For "not included" you can either use: Iif(Not [Fieldname] Like ... or you can just swap over the True and False, so if it includes xyz...
  11. K

    Run query from form?

    Can you identify the next available ticket before you change the status back? Ie store it in a variable, then change the status, then go to the ticket. Similarly, can you store the primary key of the ticket you are leaving unresolved? Use this to limit your recordset. You say your tickets...
  12. K

    loops help!

    It looks like it should be going through fine. I can't see what you're achieving by looping however, as the code inside the loop is identical every time, nothing changes. Should your ws.Range("A2"), ws.Range("B2") bits be changing each time perhaps? If so then I can see why you were using an x...
  13. K

    Create this query using code instead

    Do you need this to be a combo box, since you're limiting it to one record anyway? What I'd suggest is have an unbound (or bound to wherever your combo box is bound to) text box, possibly locked, which is populated with the current user in the OnOpen of the form. Even if you need it to be a...
  14. K

    Passing a form parameter to a combo box

    Firstly, your line: If me.OpenArgs Is Not Null Then ...should look more like: If Not IsNull(me.OpenArgs) Then ...and if OpenArgs is specifically a string then it should be: If me.OpenArgs <> "" Then Moving on, assuming that you want some code to run after the parameter is passed to the...
  15. K

    SendObject Help please!

    If the text data is not the first column in your list box then this will be why it's not coming through. Hidden columns count for this, so it's easiest to check the recordsource to find out. If it's not the first column it's usually because it's not the primary key, and the primary key should...
  16. K

    loops help!

    The setup you've got looks OK to me. The main problem is with the lines: Do While ws.Cells(2, 1).Value <> "" ...and... x = 2 + 1 ...this means that after the first go through, x will always be set to 3, but you're not using x anyway. What you need there instead is: Do While ws.Cells(x...
  17. K

    Error 13 type mismatch

    Also assuming that the function "temp" returns a single-character string...
  18. K

    Access 97 Runtime & Database Properties

    I have a developer version of Access 97 (as well as a normal version and also Access 2003), and I have a database that I need to distribute in the runtime version. I've had a problem writing to custom database properties in the runtime version. This would all occur in vb code, with input...
  19. K

    2 table query with multiple joins

    Sounds like you might need to use a Union query (although I won't guarantee that there isn't a better way!). Build your two queries, one showing all the agents at your center only and the other showing all the agents not at your center only, and save them. Make sure these two queries have the...
  20. K

    Inserting new column with static text to a 2 table query

    In your query the Field line is: Manager: "Unknown" The other lines should be blank, except for the Show box which should be ticked.
Back
Top Bottom