Works perfectly, thank you very much!
Jeff
User Profile
Collapse
-
Day of week
Hi,
I am using Access 2007. I have a report that has labels that need to be visible only on certain days of the week.
I have tried the following code in the reports load event, but it doesn't work. Does anybody have any ideas?
Code:Private Sub Report_Load() Dim vDay As VbDayOfWeek If vDay = vbMonday Then Me.Label0.Visible = True Else Me.Label0.Visible = False End
-
-
Help with INSERT INTO
Hi,
I have written the following code to insert records into a table in Access 2007:
Code:Option Compare Database Dim DueDate As String Dim PO As String Dim Customer As String Private Sub Command1_Click() CurrentDb.Execute "INSERT INTO Table2 ([DueDate],[PO],[Customer]) VALUES (" & DueDate & "," & PO & "," & Customer &
-
Help with transfertext method
Hi,
I am using Acess 2007 and am writing the data from a table into a text "CSV" file using the "transferte xt" method. I run the following code and it creates the file with a name I input at runtime and saves the file to my documents folder. I can't figure out how to specify a different location to save the file without hard coding the location and file name. Any help will be greatly appreciated.
Code:Dim
-
If then statement based on query results
Hi,
I am using Access 2007. I am trying to set up a timer event with an "If Then" statement that runs the following code:
SELECT Count([Schedule].MAS500number) as CountOfRecords
FROM Schedule
WHERE (((Schedule.Ord erClass) Like "*remake*") AND ((Schedule.Rema keInt) Is Null) AND ((Schedule.Stat us) Is Null Or (Schedule.Statu s)<>"shipped")) ;
and if the "CountOfRecords "... -
-
Hi,
One last question, what is the easiest way to replace the 10000 in the following line:
Do Until x > 10000
with a number that you enter at run-time?
thanks,
JeffLeave a comment:
-
There was a null value in the source table, once I removed it everything works great. Thank you so much for all of your help, it was huge.
thanks again,
JeffLeave a comment:
-
-
I don't know how line got pasted in my post, it's not in the code. I've made the changes and now I get a "run-time error '94'", "invalid use of null" on the following line:
Code:x = x + rsDest.Fields("TotalSF") Private Sub Command5_Click() Dim rsSource As Recordset Dim rsDest As Recordset Dim x As Long Set rsSource = CurrentDb.OpenRecordset("Schedule")
Leave a comment:
-
I modified the code and now I get the following error:
Compile error:
Type-declaration character does not match declared data type, and it highlights "Fields" behind "rsSource" in the following line:
Code:rsDest!Fields!("Customer") = rsSource!Fields!("Customer") Private Sub Command5_Click() Dim rsSource As Recordset Dim rsDest
Last edited by Niheel; May 18 '10, 06:21 PM. Reason: please use code tags and proper punctuation and grammarLeave a comment:
-
I still can't get it to work, I have included the code I have tried. I have tried it 2 different ways and both return a "type mismatch" error. Any ideas?
Code:Private Sub Command5_Click() Dim rsSource As Recordset Dim rsDest As Recordset Dim x As Long Set rsSource = "Schedule" Set rsDest = "Table2" x = 0 With rsSource .MoveFirst Do Until x
Leave a comment:
-
OK, I guess I don't understand recordsets at all. I think I understand dsatino's
"do until loop", but after the records have been added to the cutoff point how do I place them in a table so I can use them to generate a report?
thanks,
JeffLeave a comment:
-
What I am trying to do is use a recordset to generate a report that lists the oldest orders in a table up to the point were their cumulative footage's total a predetermined amount, say 1,000feet.
Example:
order #1 250 feet
order #2 200 feet
order #3 550 feet
for a total of 1,000 feet.
thanks,Leave a comment:
-
Add records to a recordset
I am using Access 2007 and am trying to add records from a table to a recordset. I understand how to add all of the records from the table, but need to figure out how to only add records until a criteria is meet. Each record contains a footage field which contains the footage of an order. I need to add records to the recordset until the total of these footage fields reaches a predetermined total. Example: say the predetermined total is 1,000... -
-
Null values in a query
Hi,
The following is a query the returns the total sq. footage of products that are in a category named "Cabinets". I am trying to figure out how to get it to return a zero when there is no footage instead of a null value. I have tried to use the NZ function, but can't seem to find the right place to put it. Can anyone help?
SELECT DISTINCTROW qrySqFtShippedL W.Area, Sum(qrySqFtShip pedLW.[Sum Of SqFtShipped])... -
Query based on other queries
I am using Access 2007 and have a query call "qryProductionR eport" that uses multible other queries as it's records source. When any of these source queries returns a null value then "qryProductionR eport" returns no values at all. Is there a way to work around this or a way to get the source queries to return a value of "0" instead of a null value?
thanks,
Jeff -
Hi NeoPa,
Your code works great so I will be switching over to it.
thanks
JeffLeave a comment:
No activity results to display
Show More
Leave a comment: