Search results

  1. W

    Range in Excel from Access

    add the Microsoft Excel Object library into you access project, and it should let you create excel ranges. It will probably be safest to use the full name when doing it though, so Excel.Range rather than just Range. Hope this helps :)
  2. W

    Challenge...Locking only a particular record!

    Well, if your users can only update data through VBA code, then it is fairly easy... you create another table of data which consists of your locked records ID, and have your VBA edit commands only allow the edits through on records that are not in the locked records list. If you are not doing...
  3. W

    Transaction Automicity does not work.

    How does it not work?
  4. W

    Recover deleted records?

    No problem :) Also if you have the time, point out to your friend that data warehouses generally don't need backing up because usually they ARE the backups dumped into one big storage archive... if its the main DB for the system, then even being a data warehouse doesn't stop the need for...
  5. W

    Encryption in VBA

    I use a hash/crypto library in my project to store md5 strings in my db for user passwords. The particular one I use is http://www.cryptosys.net/index.html#api which is free for presonal/non commercial use. Hope this helps :)
  6. W

    Recover deleted records?

    Don't think deleted records can be recovered :( About the only thing I can suggest is that your friend owns up, unless you can get that code to rebuild the db and it works going. Also, have your friend suggest a tiered backup system for future backups so that you can roll back more than just a...
  7. W

    Not getting out of loop

    Then why don't you declare your variables? :P I know java enforces this no matter what.
  8. W

    Variable type not in list

    Do you mean you need a VBA variable as a memo because a string is too small (not sure if this can happen, as I think strings have essentially no upper bound) or you need a db field as type memo, in which case you need to make the change in the table designer for the table, not in VB
  9. W

    Passing Dates and Integers in vb

    SQL will recognise it if you format it correctly and are using it to put data into the right field. Numbers don't need quotes, and you can use # instead of ' to force dates if you want, but this can cause localisation issues as it will attempt to get the correct date format for your region (or...
  10. W

    Not getting out of loop

    Option Explicit forces you to declare all your variables, using Dim and so on. It can pick up on code mistakes because without it, you could mis type a variable name and it would just create a new variable and assign the value to it... with option explicit VBA will throw up an error because the...
  11. W

    Log changes using Insert Into

    SQL should probably be strSQL = "INSERT INTO Log (Username, DataChanged, [Date], [Time], FormChangedOn)" & _ "VALUES ('" & uName & "', '" & data & "', '" & day & "','" & time & "', '" & fName & "');" as you only need to quote data, and you had a missing comma :)
  12. W

    From text box to Wordpad..

    Teessider, how about this: You output the text as a textfile, you then open up wordpad with this text file as an argument, which has the effect of opening the file in wordpad. The user does whatever in wordpad with the text, closes it and goes back to access. You then have the user click a...
  13. W

    Writing SQL in VBA

    if rstOutGoingMin is a dao.recordset (which I guess it is), you want to do set rstOutGoingMin = CurrentDB.OpenRecordset("SELECT AllNames, SUM(Salary) AS TotalSalary, COUNT(AllNames) AS TotalCount FROM REVENUE " & _ " WHERE StartDate >= '" & [Forms]![frmRevenue]![txtBegin] & "' AND StartDate <=...
  14. W

    Creating a string

    Well, you haven't returned the string ;) at the end of the function, put a line that says MakeString = stringy that returns stringy as the result of MakeString()
  15. W

    Shortening a row of information.

    Iff (InStr(columnname, " "), Left(columnname, Instr(columnname, " ")-1), columnname) should work (assuming my Iff syntax is correct)
  16. W

    RunSQL

    the DoCmd.RunSQL command can't run SELECT statements. If you want to do a select, you generally want a recordset, so they have the OpenRecordset method of DAO databases to let you use SELECT queries in code.
  17. W

    Trying to calculate sick days

    I think you have it in the wrong event. You have it in the before update event of the textbox, which will only fire when an update is about to be performed on the textbox :) Instead of putting it there, you need it in the afterupdate event of each checkbox (or write a seperate sub that totals...
  18. W

    Trying to calculate sick days

    Its probably not the Date() part. I'm guessing you are used to java or something as a computer science student (I know I was) but VB and VBA can't check for nulls with [Sickness].[End Date]=Null. You need instead IsNull([Sickness].[End Date]) to see if a value is null or not. Hope that helps a...
  19. W

    Trying to duplicate data

    you should be able to do it fairly easily. What you need is a table with all the information required for cancer patients, along with a foreign key to link to the primary key of the main table. You can then tell if a patient is a cancer patient or not simply by if they are in the cancer patients...
  20. W

    Slightly worried about file sizes

    Cheers :) I guess I am too used to more traditional compilation processes where if you compile the source from a different file, a 66% drop in file size is a worry :)
Back
Top Bottom