Thank you so much for your help. I've put the code below in: The error is occuring, I know this because when I step through the code it stops at (If Err = 3022 Then '(duplicate Key)), but then it jumps to the else statement. The record doesn't get added if duplicate, but does if not. Any ideas...
How do I handle an error within the append query? I know the error that I want to handle is conDuplicateKey = 3022, which is a duplicate key error, but I don't know how to reference this error. Can I even do this is a DoCmd command? My code is below, any help would be great!
Private Sub...
That worked, thank you so much. I also didn't know you had to declare variable separately. Thanks for that.
So, now I open my form type in the WR and the code runs and adds the information to the table. Now how do I get my form to populate based on what I just added to the table? The only...
I don't understand how this will help? Are you saying that this single1 table should be linked in the query that I'm running? How do you populate the table?
Sorry not getting it!
...As DAO.Recordset
Dim strSQL As String
Dim intEnterWR As Variant
intEnterWR = [EnterWR](IntEnterWR is set to 3283139)
strSQL = "SELECT WRInquiry.* FROM WRInquiry Where CD_WR = intEnterWR;"
Dim stPremise, stArea, stCustName, stJobAddress, stJobCity, stJobState, stJobZip, stBillName...
...change the CD_WR using a form. The SQL is below:
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim strSQL As String
strSQL = "SELECT WRInquiry.* FROM WRInquiry Where CD_WR = Forms!RefundableForm!EnterWR;"
I tried to reference the form and field. The code failed at Set rst =...
Thank you PHV. I still get a syntax error. Can you use this command to insert records into a table from a form?
What I'm trying to do is populate the OP Unit field in the subform with the parent form, which is based off a query in order to save the data from the query and the data from the...
After reading some other posts, I came up with the code below, but I'm getting a syntax error. Can anyone help.
CurrentDb.Execute ("INSERT INTO Refund Customers(ChCSSPremiseNumber, Op Unit) VALUES (" & ChCSSPremiseNumber & ", '" & Forms!RefundableForm![Op Unit] & ");")
The...
I've got the main form, which is populated via a query. The subform that's on the main form is based on the table that I want to populate. The subform contains records that users can change (just certain ones) and it also contains all the records in the table. The records the user can not...
I probably didn't explain very well. What I want to do is to be able to filter the pivot based on criteria selected on a different sheet. This is a budget file, so if someone chooses month 10, then I need months 1 - 10 to be displayed on the pivot, but not months 11 and 12.
I would do this...
Is there a way to reference the data in a pivot table field in order to manipulate the data.
For instance. I have a month field and I want to be able to choose a month "say month 10" and have the month fields on my Pivot table show Month <=10, so 1-10, but "click off" months 11 and 12.
If...
I tried this again and the date ran field didn't change, so I'm not sure why it happend the first time. I will keep changing and syncronizing and see if it happens again.
I am brining in a text file and using a recordset to manipulate the records. The code is quite lengthly.
Thank you for...
I'm trying to make a design master of a database so that I can update the database on a citrix server and replicate the changes to another server.
When I replicate the database my autonumber field value changes from Increment to Random. Also, I have a Date Ran field that enters the current...
It seems to be a data problem. We were able to get around the error by doing the following.
We created a make table from the query. Then we converted the data type of the problem column to text and back to a number. Then it works.
I don't know why this happens, but it does frequently...
I'm able to run a query in Access successfully but I get a driver error when I try to access the query in Excel. I'm trying to use the query to create a pivot table in Excel?
The error message is "[Microsoft] [ODBC Microsoft Access Driver] Invalid value for cast specification on column XX."...
I'm able to run a query in Access successfully but get a driver error when I try to bring it over to Excel in a pivot? The message is "[Microsoft] [ODBC Microsoft Access Driver] Invalid value for cast specification on column XX."
Any ideas?
...following (If-EndIf) code for the fields that may contain an apostrophe:
strWRDesc = Mid(strLine, intpos + 1, intpos3 - 1)
If strWRDesc = "*'*" Then
strWRDesc = Replace(strWRDesc, "'", "")
End If
This will remove the apostrophe from the text string.
Still not sure why...
...= Application.FileDialog(msoFileDialogFilePicker)
Application.FileDialog(msoFileDialogFilePicker).InitialFileName = ("W:\Work_Planning\PEP Update\*.txt")
With fd
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems
Set ts = fso.OpenTextFile(vrtSelectedItem)...
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.