im an idiot. i think its pulling the previous record trouble #.
i have to save the ticket first before inserting into table.
i just tried it and it worked with no problems.
sigh, i knew it was something stupid i forgot to do :P
thanks Rabbit!
User Profile
Collapse
-
Append error: table due to key violations
I am trying to insert a record into a table and when i try to do so im getting an append error:
'Database' set 0 field(s) to Null due to a type conversion failure, and it didn't add 1 record(s) to the table due to key violations....e tc
what i wanted to do was grab the autonumber (aka Trouble #) along with the date, username, and the string "Ticket Created" and insert it into the table.
my previous... -
ok looks like putting [ ] around date fixed the problem!
that was easy!
thanks everyone for the help.Leave a comment:
-
@NeoPa:
thanks for the reply. I'll have to test that out when im at work.
I tried doing table.column, but no luck.
The only other way would be to rename it to something else, but not sure where else the table is used in VBA. so it might create problems, which I definitely do not want that to happen :)Leave a comment:
-
ok after playing around with it, the culprit seems to be the "date" bc it's a reserved word?
is there any way around this?
thanks!Leave a comment:
-
Syntax error in Insert Into sql statement
Hi.
I am trying to execute the following SQL statement, but I'm getting a syntax error
Code:Dim strSQL As String strSQL = "INSERT INTO usr_problem_list " strSQL = strSQL & "(trouble_no, date, user, notes) " strSQL = strSQL & "VALUES (" & Text30.Value & ", '" & Now() & "', '" & user_name & "',
-
Jeffrey Tan replied to Is it possible to take input data from criteria and use it to replace name of a pdf?in Access@NeoPa:
I think I may have completely confused you with my goal to this problem.
Let me go back to square one.
I have a form "List of Reports" that contain the following fields
1. combobox - includes all my reports
2. command button open - opens the report
3. email button - emails the report, however, some have parameters.
There are two reports specifically...Leave a comment:
-
Jeffrey Tan replied to Is it possible to take input data from criteria and use it to replace name of a pdf?in Accesscan you briefly explain to me the filter on the report
the filter is the "WHERE" clause in the query?
I added this in the report form open
Code:Dim result As String result = InputBox("Enter Month and Year", "Tickets Opened", "m/yyyy") Me.Filter = "Format([user_problem_log.date_closed],'m/yyyy')='" & result & "'"
Leave a comment:
-
Jeffrey Tan replied to Is it possible to take input data from criteria and use it to replace name of a pdf?in Access@NeoPa:
I'm a bit confused. Can you show me an example or some code that'll help me understand this problem?
You're saying that I need to include a control in a form and the value I type into the control will be used in the report.
So it's going to be a two step process?
Create a form with one text field and a button. when i enter the formatted date (mm/yyyy) and i click the button, the value from...Leave a comment:
-
Jeffrey Tan started a topic Is it possible to take input data from criteria and use it to replace name of a pdf?in AccessIs it possible to take input data from criteria and use it to replace name of a pdf?
So i have a parameter query that accepts the value of a date. when i run the query, the input box or criteria pop up appears, asks me for a date, and then the results appear..
is it possible to take whatever i typed in the criteria and use it later when i want to send an email and take that date and use that as my pdf name?
1. i open the parameter query report
2. a popup box appears and asks to me put in a date... -
@Rabbit:
Yes the query works.
i know what's the problem lol.. it's the naming convention..
i put a "/" in the query name and report and windows file names cannot have a / in the name... so what access did was replaced the / with a _ and that changed the whole report name, hence it was canceled.
Problem Solved!
:DLeave a comment:
-
Error when emailing a parameter query report
Hi there..
So i am trying to email a parameter query report that takes in a date formatted to m/yyyy and compiles a report based on the specific month and year.
however, when i click the command button to email the report, the input box window pops up, i type in a month and year, say 6/2010, then hit enter and then it breaks into the following code highlighting it yellow:
Code:DoCmd.OutputTo acOutputReport,
-
@NeoPa: yeah i didn't know either lol.
So I guess this would be a good reference for those who want to try the same and gets to this problem as well :)Leave a comment:
-
omg finally i fixed it!
i reinstalled MS office and adobe acrobat... still the same problem.. so i figured i'd google it and see if anything came up.
Turns out that I was missing an addin for 2007.
http://support.microsoft.com/kb/934833
so i downloaded the Microsoft Save as PDF or XPS addin, installed it and now it works perfectly :)...Leave a comment:
-
@NeoPa:
Yeah the database was recently converted from 2000 (or 2002, i forget) to 2007. doubt it has anything to do with the fact that he's using windows 7 and i'm still on XP. maybe ill try to reinstall access 2007 and adobe pdf.Leave a comment:
-
@Rabbit:
Thanks. Ill take a look at that.
Reason is because the DB is still 2000, even though it's converted to 2007. the icons are still coming from 2000 and they look super old LOL.
do you know the maximum filesize or dimensions to use the icons on buttons, etc?Leave a comment:
-
where to get icons for forms?
Where can i get icons for forms to make them have a nice look and feel to it.. the forms look kind of bland.
for example:
http://office.microsof t.com/en-us/templates/results.aspx?ck =1&qu=problem&a v=zac140#ai:TC0 10206880|
the icon for the case details looks nice..
is there a way i can get something similar?
Thanks! -
ah i noticed something else...
see the attached screenshot..
there's no PDF format.
i looked at my colleague's computer and there is PDF... now i'm 100% sure that is the problem....Leave a comment:
-
@NeoPa:
Yeah I was missing the ( ). Huge difference. Code works perfectly.
here's what i have :)
Code:With Combo46 If (.OldValue = "CLOSED" Or .OldValue = "CANCELED") And .Value = "OPEN" Then date_closed = "" Combo56 = "" With Me.Child39 DoCmd.GoToControl
Leave a comment:
-
ok im at work now and i fixed the additional "\" but still the same problem.
here's the code:
Code:Sub sendEmail() 'Provides the Send Mail automation. Send an E-Mail and Attachment from Access via Outlook Dim oLook As Object Dim oMail As Object Dim olns As Outlook.NameSpace Dim strRecipient As String Dim strBody As String Dim strSubject As String
Leave a comment:
No activity results to display
Show More
Leave a comment: