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...
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...
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
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...
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...
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
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...
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] =...
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...
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...
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...
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...
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...