Search results

  1. B

    Getting values from multiple queries

    All of the data is in one table initially, with [StartDate] [EndDate] [FuelUsed] and [Location] as fields (again with others that are not relevant at the moment). I have a set of queries that takes the data and sorts it by location, so then I have 10 versions of the table. In the main table...
  2. B

    Getting values from multiple queries

    I tried a Union query, but what I got was 3 columns with [StartDate] [EndDate] [FuelUsed], and the data in it, as opposed to a [FuelUsed] Column from each separate location. I should maybe have been a little clearer, the start and end dates are all the same in each table as they come from week...
  3. B

    Getting values from multiple queries

    Hi, I have 10 different queries, all of which contain a field [StartDate], [EndDate] and [FuelUsed] - amongst others. They come from different tables that have been input by users in differing locations (hence the separate tables/queries). What I need to do is get the data into this form...
  4. B

    Sum in VBA

    That sorted it. Thanks. I knew it was something basic, but couldn't find out what.
  5. B

    Sum in VBA

    I hope there is a very simple answer to this (as with all the questions I have!)... So here is my code: Dim FuelCal As String Dim FuelGel As String Dim FuelHav As String Dim FuelKil As String Dim FuelLin As String Dim FuelMus As String Dim FuelRam As String Dim FuelWar As String Dim...
  6. B

    Deleting duplicate records

    Rx, I'm only creating a database for the tugs to report their crewing to the office in a simpler way than they currently do, not for keeping the records on board, and also it's only editing the records if people sign off before their expected dates, if they were moved to another vessel for...
  7. B

    Deleting duplicate records

    I decided that this was all far too complicated... Went for this instead: If DCount("*", "CrewQ") > 0 Then MsgBox ("Please edit sign off date") Else So now there's a query [CrewQ], and if the sign on/person combination already exists then the user is prompted to edit the dates... BUT... It...
  8. B

    Deleting duplicate records

    Right, back again with another issue. I've tried googling, and have not been able to make sense of the information. In terms that a complete novice would understand, can anyone help with this? I have a table ([WatCrew]) where the dates of crew on board a boat are entered, relevant fields are...
  9. B

    Filter query results - help please!

    Hi, Probably (another) simple question, but I have a query running on 2 other queries. Basically I have a query that returns the crew on board a vessel during a given date range, and another table giving the emergency drills carried out during that time. The third query takes the date of the...
  10. B

    DLookup strange issue...

    Thanks, that's worked, I was just having a moment ;)
  11. B

    DLookup strange issue...

    Thanks! That looks a lot neater... but has caused me some confusion... I went through it and updated my code, and got nothing in the text boxes. So in the 'if' statement I added a messagebox with the exact same statement - this gives me the right value, but still nothing in the text box...
  12. B

    DLookup strange issue...

    Would this be right? Dim rsObj As DAO.RecordSet Dim WkEnding As String Dim WkEndingSQL As String WkEnding = DateAdd("d", -1, [Forms]![TestEngDataNew]![WkSt]) WkEndingSQL = Format$(WkEnding, "\#mm\/dd\/yyyy\#") Set rsObj = "SELECT [Field1], [Field2] etc. FROM [WatEngDataWeek] WHERE [WkEnd] =...
  13. B

    DLookup strange issue...

    Thanks... I just need a little clarification. Do I need to reformat every date in the DLookup query, as in the date from [WkEnd] as well as the WkEnding date? I'm learning this whole thing as I'm going along...
  14. B

    DLookup strange issue...

    I have some code to look up the data from a previous week's entries to fill a form. It seems to work fine, unless the previous week crosses a month end. As in if the week runs from the 1/1/13 to 7/1/13 then then I go to the data entry form for the week starting 8/1/13 and everything is fine...
  15. B

    Fill textbox from previous data in table and return to table

    GasOil = DLookup("[GOEnd]", "[WatEngDataWeek]", "[WkEnd] = #" & WkEnding & "#") Worked for me, all good now!
  16. B

    DLookUp runtime 2471

    The saga of my access attempts continues... I'm trying to get information from another table WatEngDataWeek, in the field WkEnd and fill it in to a text box on a form called TestEngDataNew WkEnding = DateAdd("d", -1, [Forms]![TestEngDataNew]![WkSt]) MsgBox (WkEnding) lookup =...
  17. B

    DLookUp runtime 2471

    The saga of my access attempts continues... I'm trying to get information from another table WatEngDataWeek, in the field WkEnd and fill it in to a text box on a form called TestEngDataNew WkEnding = DateAdd("d", -1, [Forms]![TestEngDataNew]![WkSt]) MsgBox (WkEnding) lookup =...
  18. B

    Fill textbox from previous data in table and return to table

    WkEnding = DateAdd("d", -1, [Forms]![TestEngDataNew]![WkSt]) MsgBox (WkEnding) lookup = DLookup("[WatEngDataWeek]![GOEnd]", "[WatEngDataWeek]", "[WatEngDataWeek]![WkEnd] = WkEnding") Gives me a run time error 2471, with error 'WkEnding'. The message box was just put in to make sure that the...
  19. B

    Fill textbox from previous data in table and return to table

    I think (hope) that this is a simple problem, but I can't get my head around it. I'm still a novice at the whole vba/access game, so please reply in simple terms... I have a table to calculate fuel usage etc. over a weekly period - the user enters the date at the start of the weekvalues at the...
  20. B

    Save Excel Sheet as, and then break links... How?

    The saga continues... My logic went something like this: I know how to break links from inside excel, so I recorded a macro to do this, then edited it to get the appropriate command, copied it accross to my code in access. The result was this: xlApp.ActiveWorkbook.BreakLink Name:="FILENAME"...
Back
Top Bottom