Search results

  1. A

    Edit locked cell in protected shared workbook

    Hi, hoping someone has some bright ideas for this... I am wanting to put a notes section into a workbook, where notes can be added about a particular row in a worksheet. There will be lots of rows. I want these notes to be uneditable once they have been written, so they can't be tampered with...
  2. A

    Updating two fields in two different tables from one fold in a form

    What do you do when you receive new supplies of chemicals? If you added them to the tblChemRegister table as well as the usage, then you wouldn’t need to update another table with the quantity available, as you could just do a sum of the quantity field in the register table and it will give you...
  3. A

    Multiple if statment

    For things like this, I normally add a tag to fields that need checking of “required” then in the code loop through each object in the form and if it has the tag “required” it then checks for if len(nz(ctl.value, vbnullstring)) = 0 then tell it what to do if it finds one that is null. For...
  4. A

    Range help

    Hi All, I have a requirement to copy some data from one sheet to another and then do some formatting etc. on it. At the moment the copy is manual from one sheet to another, but the formatting and sorting is scripted and working fine. What I would like to do, is the user to click a button...
  5. A

    Dealing with apostrophe's

    Undoubtedly it would, but as I said don't know if its the right way or not, but in the situation in which I use it, it works fine and has done for a couple of years now and solved the problem i was having with apostrophe's.
  6. A

    If/Then Statement

    Else iResponse = MsgBox("It appears that there are records in this table with that date, do you want to continue??", vbYesNo + vbCritical, "HOLD UP") If iResponse = vbNo Then Exit Sub End If End If End If Could just be ElseIf MsgBox("It...
  7. A

    VBA editor not opening

    Does F11 work? Sounds like need to reinstall Access to me.
  8. A

    Dealing with apostrophe's

    Don't if this is the correct way of doing things or not, but this is how i do it in my system and it seems to work fine: INSERT INTO some table (textfield) VALUES ("""& textfieldname &""") Replace '"& fieldname &"' with """& fieldname &"""
  9. A

    Out of memory

    This doesn't happen when I try and run code, it's coming up when I am designing a form or trying to write code. I have nothing like that running, there is a hidden form running in the background, but all that does is mark user as logged out when it closes, nothing else, and there is a timer...
  10. A

    Out of memory

    Nope, everything looks normal, system resources aren't maxing out, memory showing at 31-33%, CPU @ 9% Just deleted and re-created the forms and it's not happened now, but i haven't got VB editor open, just about to try that and see if it causes it to crash.
  11. A

    Out of memory

    Hi All, Today i have had a random error start popping up after a short while of having the app open and doing some development work. it will randomly pop an error box up say "Out of Memory", and i can't do anything else in Access, i have to close and re-open, but it always comes back up. Was...
  12. A

    Stuck in Loop

    You need to move to last record, then back to the first record to get it to work, below is how I normally do a loop on mine. As you're getting the data in the record set, then so long as the data you want is in there, you don't need to use a DLookup and can user rs("FIELDNAME") Dim rs As...
  13. A

    Calculating consumption

    Just had a look through that last example DB posted, the usage shown in the second column for each meter, is the difference between the current meter readings and the first meter reading. Not sure what the OP is looking for, but I would imagine it's the usage between each meter reading not...
  14. A

    Calculating consumption

    You need to tell Access what the latest date is, LatestDate is a variable, which needs to have a value assigned to it.
  15. A

    Calculating consumption

    If the dlookup is failing at that point, then you've got it wrong somewhere, or else it's the way your storing the data. the dlookup just returns values from where you tell it to, based not eh criteria you enter. You are then taking away one value from another, ie the latest reading from an...
  16. A

    Calculating consumption

    This should work as the basic premise behind the consumption calculation, exactly where you use it and how you use it will need tweaking slightly to match the scenario, for example where are you going to get the MeterID from and where are you going to get the latest date from, that depends on...
  17. A

    Calculating consumption

    You could use a combo box, or a list box to select each meter, then have a text box with the date in and another for the reading. Or you could have a button that creates an entry in the table for each meter with a 0 for the reading, or even leave NULL, then use a data sheet to go through and...
  18. A

    Calculating consumption

    The dlookup above will work for you, however, as you have 20 meters, and are storing then all in the same line in the table, then you are going to have to have 30 formula's to calculate what you want, and if you want to add a new meter you'll need to alter the table layout and add new formula's...
  19. A

    Calculating consumption

    Assuming the spreadsheet is the actual table layout you have, then i don't think that's the best way to store the data myself. Depending on how many meters you have, or may have in the future, you would either want to store the readings by the meter or the utility, you would find it better to...
Top Bottom