Bit stuck here but bet it is really stupidly simple I have the following code to export a query into a spreadsheet which worked fine but after I added the path name which is in bold it no longer works.
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97, "NME With Company Code", C:My DocumentsTDL Update(Format(Date, "mmmm")) & "'s TDL Information", True
what am i doing wrong what I am looking for it to export this to a specific folder in my documents.
Hi All, I'm new on this forum and not that experienced in coding. I am making an export to Excel and am wondering if (and how) I can set a Fliter on output. I have a db for keeping scores for contests, this db is used by several people in diferent locations, so I would like them to export there own contest and me importing this in my own db. I need to have a complete (all contests) db for competion rankings. Thanks for replying !
I need to: Take the result of a query and export it to excel. Manipulate the data in excel. Re import the same data into a table And finally put the table into an existing form
I have succesfully created the macros to Export the data and Re-import the data
BUT I have to mannually open the spreadshhet and save it for the RE-Import to reflect the updated data from the ss.
Everything works fine except the column which contains 'Material' holds both numeric and alpha-numeric values. For example these are both material numbers: 156952 and 1238707-202. The data in this column is formatted as General. The data type for Material in tblMPSDATA is Text, 18 character length. The alpha-numeric materials are all at the end of the file. When I import, an error table is created listing the alpha-numeric materials with the error 'Type Conversion Failure'. But if I have an alpha-numeric material in the first row of data then everything is imported just fine.
I have set up a nice little popup form with a file path and command button for controlling the process of bringing in this data. I really do not want to have to add special instructions about making sure the Excel data is sorted in a certain manner prior to importing. Any thoughts on why Access is not treating everything in this column as text?
I used the DoCmd.TransferSpreadsheet method to export from an Access 2003 table to Excel. The table had around 440 fields but only 230 (column iv) got exported.
Does anybody know whether there is a limitation on the number of fields that can be exported.
where tblTS1 - tbl where I'm putting the data filename - c: est.xls Product!A1:H100 - range of data I want in sheet Product
I am having problems w/ the "range" portion of Transferspreadsheet (I know it's this portion, because it works when I pre-name the range in Excel). I have tried all sorts of variations on the syntax:
I get the error msg: The MS Jet database engine could not find the object '$:'. Make sure the object exists and that you spell its name and the path name correctly." or "Syntax error"
I wanted to mistake-proof the data transfer, so I did not want to: - predefine the range in Excel (under InsertNameDefine) - have the user enter values in text boxes
Any help w/ the syntax would be greatly appreciated!
I have been using a transferspreadsheet cmd for a while now in Access 2003, but when I recently split the database so that the table the import is going to is now linked rather than residing in the same mdb file, I get a numeric field overflow error. I manually made all the values in the import 0, converted it to text, but got the same error.
When I imported the table back into the file, rather than having it linked, the transfer worked fine.
Can you not run the transferspreadsheet command on a linked table or am I missing something?
I have a form which has a subform. For each record, I have to assign a user, which comes from a user table. Due to the large number of users I have created a user selection form, which is designed as a popup. This form has an option group to select department, which then filters a combo box for selection of a user. On clicking a user, the window closes and that username is inserted into the form.
Since this particular user form will be used in multiple locations, I was thinking of having a global variable, which is set when a field is clicked. i.e. a variable called nameSelect. When a user is being assigned in form A, the user field is clicked, nameSelect = 3.
I was then thinking of having within the user selection form coding a Select Case function which depending on the value of nameSelect assigned the selected user to the correct location.
I am writing an event procedure to check to see if a particular Project number exist in a recordset. I am trying to use the findfirst method and are having some problems. Here is my code.
Private Sub Command3_Click()
Dim db As DAO.Database Dim rs As DAO.Recordset, ProjectNo As String, SqlStr As String, StrProjectNo As String
Set db = CurrentDb() Set rs = db.OpenRecordset("tblTrackingSheetFrm", dbOpenTable) StrProjectNo = Me![ProjectNumber] rs.FindFirst StrProjectNo
MsgBox " Project worksheet already opened by another user."
rs.Close End If End Sub
What this does is check to see if another user has a project open and if so doesnt allow that user to access that project. I am getting the following error when I execute the procedure on the findfirst Code line.
Runtime error 3251 Operation is not supported by this object type. Can someone take a look and see what I am doing wrong. Any help is greatly appreciated.
I just want to ask what is the best method to deliver an application to the user. The reason of asking is that it needs user to have access software installed which is not cheap Any other method that can help, some sort of exe file that can run without access software or atleast something free...
When trying to use FindRecord I get a "Runtime error 2406 - the command or action 'FindRecord" isn't available now". The script up to that point is as follows:
Sub Test()
Dim Connection As New ADODB.Connection Dim Catalog As New ADOX.Catalog Dim rstRain As New ADODB.Recordset Dim ppn_0900 As Field
Set Connection = CurrentProject.Connection Call rstRain.Open("0800Rain", Connection, adOpenForwardOnly)
I've recently begun building a database to keep track of stock at work. Nothing particularly special or difficult. I have a little bit of prior experience with Access and VB, but not heaps.
Basically, I've created a tables for parts, companies etc, and am relating all the data together.
At the moment I've made a form that allows you to enter a new part, with Part Number, Description, Category, Supplier, etc.
The complication comes when I want to create an ASSEMBLY of parts. I'd like to create an assembly (which has a lot of similarities to a part, in that it has a part number, description etc), and that assembly needs to store a list of parts that it includes. A simple assembly might include a few items, ie, a bowl of meatballs includes the bowl, a fork, the spaghetti, and 5 meatballs. A more complex assembly (a complete dinner for 5) might include 5 bowls of meatballs (a sub assembly), pepper and salt, 5 glasses and two bottles of coke.
I'm not sure how to best store this assembly data...
I can't really have a table with a finite number of "part" spots because the assemblies get quite large. I'd rather not use an ugly VB macro that stores the PartID's with quantities either, as that could get thoroughly out of hand pretty quickly.
I'm sure there must be a simple method for doing this, but without having a clue as to what it might be called I can't really look for it in help!
i have set the dropdown method of a combobox in the onfocus event if then on the click event or exit event for the combobox i validate the entry and find error and move the focus back to the combobox the dropdown method does not appear to work.The focus has clearly been moved away from the combobox but when it returns the dropdown list does not appear yet it always works the first time you enter the combobox within a form
has anybody else come across this problem! any solutions
I want to have my records in my form show the latest entry, not a completely new form. The user will click on the new record button to create a new record but I want the user to be able to see the last record. Anybody know how to do this?
Hello. I am quite new to Access and even newer to this forum. So please be gentle...
My question is quite simple i think. I want to display one particular record.
I have a keyboard wedge barcode scanner.. so basically a quicker and easier way to input digits or letters into a field. I also have lots and lots of CD's DVD's which i want to track and list the contents of, by simply entering the cd/dvd's barcode number istead of having to insert into my pc and browse manually.. if possible searching within results would be good too.~ think of it as a supermarket style.. input number - output entire contents... there could be hundreds or even thousands of programs or music titles,images, videos or documents.. along with any associated data, (where it is stored, who borrowed it last etc)
Can anbody outline the basics for me to implement this? remember i am quite new to Access and databases in general.
Thanks in advance, and keep up the good work on/in this forum. :)
I want to be able to make an exact copy of an existing record in a table and then change the value of a couple of the fields before writing it to the table as a new record.
What is the best way to go about this? I guess it is possible with select, update and append queries but I'd rather do it in code.
It sounds like it should be a simple and commonly performed exercise but I can't find anything on it.
Hello, I would like to use the FindRecord Method, but something does not work. I would like to find a record which contains the data I entered in an unbound textbox in the form. The action should be started by a command button. As 'Find what'-object I used '=[text61].[text]. Thanks for your help.
I’m working on a report that I want to show on the web as a Snapshot file. I created a Macro using OutputTo method to export the report. If I type the file name and location on the Output File it works perfectly, but the problem is that I want Macros to read the file name from a combo box since the file name will change every day. Here is the code I got so far.
C:Test””&FORMS!frm_FORM2!cbo_Name&”.snp”
Every time I run this Macro I got the following message:
“The report snapshot was not created because you don’t have enough free disk space for temporary work files.”
Now!, when I type the file name to that specific location Macro does the job perfectly.
Is there any way I can get the File name from a combo box located in FORM2.
Thank you so very much in advanced. Your help is always a blessing.
Getting an error on the rst.Open statement of "Method 'Open' of object '_Recordset' failed"
I am using the same code that I have used before, just tweaked some. Earlier I had an error because the ActiveX control was not checked off for the ADODB connection.
Below is the code...any ideas? THANKS!
Dim Conn As ADODB.Connection Dim rst As New ADODB.Recordset Dim lg As String Dim frmOffset As String Dim tagnm As String Dim sql1 As String Set Conn = CurrentProject.Connection
frmOffset = "3. Offset Printing" lg = "PT" tagnm = "Label22" sql1 = "select translation from translation where lang=" & "'" & lg & "'" & "and formname=" & "'" & frmOffset & "'" & " and tagname=" & "'" & tagnm & "'"
Hi, I want that when a value from combo box is selected, based on it the values in the text box should appear. These are all bound columns.
I have written the following code and getting as error "Run time Error 3075" syntax error "missing operator" in query operation at line - >Set rs = db.OpenRecordset(strSQL) in the following code appears. Please help.
Private Sub Assigned_To_LostFocus() Dim db As DAO.Database Dim rs As DAO.Recordset Dim strSQL As String
Assigned_To.SetFocus If Assigned_To.Value > 0 Then strSQL = "SELECT * FROM Department WHERE Assigned To = " & Assigned_To.Value
Set db = CurrentDb Set rs = db.OpenRecordset(strSQL)
If Not rs.BOF Then Me.Text65 = rs.Fields(1) / Me.Text65 = rs("code") Me.Department = rs.Fields(2) / Me.Department = rs("Department") End If rs.Close Set rs = Nothing db.Close Set db = Nothing End If End Sub
This seems to work okay in Access 2000, but I understand the DoMenuItem method is obsolete, and that I should replace "DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70" to a RunCommand method, but I am not sure about this. I would be grateful for any help in replacing this piece of DoMethod code with RunCommand code! mcchu
Is there a way of finding out who is turning18 years old in the next 6 months on a set day.
Specifically, I want to minus a date of birth from todays date (DateDiff?) and then for it to show those people who will be turning 18 in the next 6 months.
I've tried a range of Datediffs but I can't seem to get what I need.
Can anyone tell me what the 'ac' part of a method, such as 'acReport', actually means. I am guseeing it may be something like Active Command or similar.
There is no other reason that curiosity for me wanting to know this...or is there??
I want to disable a button right after click it. Because I could not disable a control that has got the focus, i tried to shift the focus to another control; however, all controls that I tried to shift the focus to don't support the method (SetFocus = true).
I want to do this on a subform's control, but I keep getting this error: Object does not support this property or method.