Search results

  1. C

    Make a Table Name from a Parameter

    I have got the code to run the same query many times by passing a parameter through as follows: DoCmd.DeleteObject acTable, "tbl BranchParameter" Set cmdRunQuery = New ADODB.Command With cmdRunQuery .ActiveConnection = CodeProject.Connection .Properties("Jet OLEDB:Stored Query") = True...
  2. C

    Changing a Data Type within a table

    Is there anyway in VBA that I can open a table and then change the data type of a field from Number to text and close the table again? I have got the following for the opening & closing the table but it's the data type bit which I am missing: Docmd.OpenTable "tbl 1c Final Product Sales By...
  3. C

    Exporting to Excel

    I am trying to export an 18,000 line query to Excel in a macro without using the Save Formatted function. Is this possible?
  4. C

    Getting January to show as Default

    I tell a lie, it works Thanks!!
  5. C

    Getting January to show as Default

    This gives me 20031 but I need 200301 Is there anyway this can be done?
  6. C

    Getting January to show as Default

    I have got a textbox on a form & I would like the default value to be the year (2003) & then January (01) (i.e. 200301). I can get the year by using the first part of the following formula but I am unsure what to put after the & to get 01 =Year(Date()) & ------- Any Ideas? Regards Carly
  7. C

    Date Formulas

    The unknown was just there to see whether February didn;t come into any of the other categories as I couldn't underststand why it wasn't changing. 9,10,11,12 do not need to be year()-1 because if the month is october then the start of the period is September in the same year. I didn't mention...
  8. C

    Date Formulas

    Thank you!
  9. C

    Date Formulas

    I have used the following formula: =IIf(Month([txt1stdate])>=3 And Month([txt1stdate])<=8,DateSerial(Year([txt1stdate]),3,1), IIf(Month([txt1stdate])>=9 And Month([txt1stdate])<=12,DateSerial(Year([txt1stdate]),9,1),IIf(Month([txt1stdate]) =1 or...
  10. C

    Date Formulas

    NO what I want is if the [txt1stdate] is march, april, may, june, july or august then put in 01/03/(current year) otherwise put in 01/09/(prior year) The reason being is that our trading periods run from Mar to Aug and Sep to Feb therefore the beginning of the trading periods are always Mar or Sep
  11. C

    Date Formulas

    I have a textbox with the following formula: [txt1stdate] = DateSerial(Year(DateAdd("m",-1,Date())),Month(DateAdd("m",-1,Date())),1) which comes out as the 1st day of the previous month (i.e. 01/07/2003). What I would like to do is create another textbox which works out a date from the above...
  12. C

    Like Function using a Textbox

    Thanks that works brilliantly
  13. C

    Like Function using a Textbox

    The rest of the text in the field is the time to accompany the date. The textboxs which I am refering to have default values of the following: [txt1stdate] = =DateSerial(Year(DateAdd("m",-1,Date())),Month(DateAdd("m",-1,Date())),1) (i.e. The first day of the previous month) [txt2nddate] =...
  14. C

    Like Function using a Textbox

    This works fine, Could I use this for Between....And.....?
  15. C

    Like Function using a Textbox

    I am trying to get data out of a linked table (cannot modify) where the datatype is Date/Time. When I type in 31/08/2001 in the criteria it doesn't bring any data out but if I type Like "31/08/2001*" it works, which is fine if I was going to type the date in each time manually but the query...
  16. C

    Ever Changing Passwords

    I have got a textbox on a form called [password] and in this textbox is a calculated number (todays date backwards). I want this number to be the basis for a password, but how do I lookup this number to check whether a user has entered the correct password. I have tried DLookup but it doesn't...
  17. C

    Ever Changing Passwords

    I'm not sure where this post should be so I thought I would try General. What I want to do is this: Click a button on a form which opens some kind of password entry form or textbox On entry of the correct password a certain report runs but if the password is incorrect or blank then another...
  18. C

    Setting Primary Keys in a Table

    I have a query which updates a table but when this happens the primary keys are removed. Is there any way in which i can reset the primary keys. I have tried the following code: Docmd.OpenTable "DML Initial Stock",acDesign Docmd.RunCommand.acCmdPrimaryKey But this only sets the key on the...
  19. C

    Mixture of Functions (macros, modules & reports)

    Where would I add that to? Sorry I'm still learning Regards Carly
  20. C

    Mixture of Functions (macros, modules & reports)

    Chain of events: a) Click a Button on a form b) Runs a module with code as follows: Private Sub Stage_6_Click() retvalue = _ MsgBox("This Option will print the delivery notes. Select OK to continue or cancel return to the Form", vbOKCancel, "WARNING") If retvalue = vbOK Then DoCmd.RunMacro...
Back
Top Bottom