This should be an easy question, but I can't remember how to do it for the life of me.
I have a field [Rev_Pub_Date] which is formatted as a date. I want another field [Next_Rev_Date] to be automatically set two years later.
Right now I have Next_Rev_Date = Rev_Pub_Date + 730, but this...
I am getting an "Object Required" error on the line marked below. Any ideas why?
Dim dbTemp As DAO.Database
Dim rsTemp As DAO.Recordset
Dim strSQL As String
Set dbTemp = CurrentDb
strSQL = "SELECT T_Dates.Rev_Pub_Date, T_Dates.Current FROM T_Dates " & _...
New problem. Now I'm getting an "Object Required" error on the line marked below:
Dim dbTemp As DAO.Database
Dim rsTemp As DAO.Recordset
Dim strSQL As String
Set dbTemp = CurrentDb
strSQL = "SELECT T_Dates.Rev_Pub_Date, T_Dates.Current FROM T_Dates " & _...
I Feel so dumb. I didn't bother to check the field name. It turns out that for some reason, I used CurrentCk as the caption, but the actual field is Current. It's working now. Thanks.
I Feel so dumb. I didn't bother to check the field name. It turns out that for some reason, I used CurrentCk as the caption, but the actual field is Current. It's working now. Thanks.
Here's the SQL statement:
SELECT Rev_Pub_Date, CurrentCk FROM T_Dates WHERE (((T_Dates.Proc_ID)=45) AND ((T_Dates.CurrentCk)=-1)) ORDER BY Rev_Pub_Date;
When I pasted it, I selected to view the data and two parameter boxes came up. One for CurrentCk and the other for T_Dates.CurrentCk.
What...
I don't fully understand where you mean when you say, "Paste it directly into the SQL view of the QBE (or here) and check if it is a valid SQL..."
Larry DeLarvelle is looking at this with me, but I wanted to see of anyone else had any ideas. Can someone tell me why I get an error "too few parameters. Expected 2." at the Set rsTemp = dbTemp.OpenRecordset(strSQL) line in the following code? My field types are as follows...
I tried it, to no avail. I still get the same error, "too few parameters. Expected 2." My field types are as follows:
Rev_Pub_Date is a date field
Proc_ID is numerical
CurrentCk is a checkbox (Yes/No)
Here's my updated code:
Dim dbTemp As DAO.Database
Dim rsTemp As DAO.Recordset...
Larry, here's my modified code:
Dim dbTemp As DAO.Database
Dim rsTemp As DAO.Recordset
Dim strSQL As String
strSQL = "SELECT Rev_Pub_Date, CurrentCk FROM T_Dates "
strSQL = strSQL & "WHERE (((T_Dates.Amdt)='" & Me.Amdt & "') and ((T_Dates.CurrentCk)=-1));"
Set...
Larry and Golom,
I found the references area. I understood Golom to say just to open a form, but in actuality I needed to open the VB window, then use the Tools menu.
Larry, I'll get back with you about helping modify the code.
I apologize, but I do need some help customizing the code.
The table name is T_Dates with the following fields:
Amdt
Rev_Pub_Date
Next_Rev_Date
Remarks
CurrentCK
Do you need anything else? I'm going to try tweaking it myself as well.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.