I have a query that I dump into a table...via Macro. I made changes in the table (User Input in some fields) ..can I requery and not overwrite the inputs? I am new to Access not sure if this is possible?
I have a query that lists all tables within my access database.what i want it to be able to click the table name from the query list.for example my query list is:
Rawdata Outcomes Reporter Tracker
how would I click on Tracker and open in up the tracker table? is it something like
I have three tables: Vehicles; Vehicle Reallocated; and Vehicles Retired. I have a form that runs a query to find all the info in the Vehicles tbl that is not "Retired", not visible in the form. I then have the option to toggle to a Reallocated or Retired form. When i toggle to the reallocated form, i have the like fields in that table (ie Van #, Vin, Make etc) pulling the info from the hidden subform with the vehicle query, so i do not need to fill in repeat data. However, when i add a reallocated date and the new clinic that vehicle is for, i get the record ID for the vehicle reallocated table as expected, but when i save none of the data moved over from the query saves in the record?
How to get all the data on the reallocated form to save?
I need code for save dialog file ,and select the file from textbox and save it to the selected location.i have only this code and i dont know what else i can do with this because it just opens the save file dialog !
Warehouse inventory system in access 2003. I have set up two primary tbls: Equipment and ETO (Equipment transfer order) both have an autofill primary key and the equipmentID is part of the ETO tble. There is a one-to many realationship from the equipment to the ETO. There are other tables (4) in the system but they are used as look-up tables and i'm not concerned about those.
Equipment Table layout: EquipmentID, ModelNumber, SerialNumber, Mfg, ProductName, CurrentLocation, Category. This table is used as the repository for all of the equipment that needs to be tracked and inventoried. It will not change much with except the CurrentLocation changing as the stuff is shipped around (in Store, In Warehouse) and of course when new equipment is being added.
ETO table layout: ETOID, ETONumber, FromStore, ToStore, OriginStore, ETODate, ModelNumber, SerialNumber, MfgID, ProductName, LocationID, CategoryID, EquipmentID. This table will be used (I hope) to basicly track the equipment as it moves from store to store to warehouse and back out again.
Process: Locate a peice of equipment by either SerialNumber or ModelNumber in the Equipment Table, change the location depending on it's status (coming in, going out) then i need to somehow update the ETO table with that ModelNumber, SerialNumber, Mfg, category, etc..But put in the FromStore, Tostore, OriginStore, ETODate, etc..
I have tried both the update query and append query from both tables but I can't get the results i need.
What is the correct way to save the values in a listbox column to the fields of a table? I can use rec("field1") = Me.list16.ItemData(Varitem)and that records the bound column to field 1 but how can I save the unbound columns to other fields in the table?
I want to save an Access query result to a Table, but I couldn't find a way. The only thing I can do is save the result to excel or as a query in another file. Any hints? Thank you very much.
I want to be able to open a Table as Read Only, so that a user can browse etc., but neither alter nor enter data - I want them to use the Forms for that. How then, using VBA code, do you open a Table as Read Only?
I am using Access 2003.I have created a Makle Table Query which gives me the invalid argument error because it makes the database balloon to over 2gb. I have two questions:
1. Is it possible to get the make table query to save data in one database until it reaches say 1.9 gb and then begin saving the rest of the data in another database?
2. Is there a wey to pause or stop a make table query to see the results and then let it run again?
Does anyone know where I can find a sample db that will let the user do the following:
Selected a file from their computer and upload to a the same folder as the db?
I am building an Investigation database. This function will allow the user to attach file to an investigation. (the files will be stored in a folder and logged on a table)
I have a form. It has about 75+ bound text boxes, and about 25+ unbound text boxes that calculate values. And about a dozen command buttons. The code behind all this mess prints off in about a dozen pages.
Everything works. BUT, it takes around two or three minutes from clicking to open the form before the form appears. (There is no delay in moving between records.)
If I go into design mode, it takes anywhere from 10 to 20 minutes for it to save changes.
I noticed things really slowed down as I started copying controls.
Is there anything I can do to speed up this monster?
Hi every body . I found this code that supposed to allow me browse for .mdb file and select it. But unfortunely i could not set it up. could an expert help me set this up in access 2000. Furthermore how i can refrence the loaded .mdb file when ever i want to use it instead of current db in vba.Thanks
Code:***************** Code Start **************'This code was originally written by Ken Getz.'It is not to be altered or distributed,'except as part of an application.'You are free to use it in any application,'provided the copyright notice is left unchanged.'' Code courtesy of:' Microsoft Access 95 How-To' Ken Getz and Paul Litwin' Waite Group Press, 1996Type tagOPENFILENAME lStructSize As Long hwndOwner As Long hInstance As Long strFilter As String strCustomFilter As String nMaxCustFilter As Long nFilterIndex As Long strFile As String nMaxFile As Long strFileTitle As String nMaxFileTitle As Long strInitialDir As String strTitle As String Flags As Long nFileOffset As Integer nFileExtension As Integer strDefExt As String lCustData As Long lpfnHook As Long lpTemplateName As StringEnd TypeDeclare Function aht_apiGetOpenFileName Lib "comdlg32.dll" _ Alias "GetOpenFileNameA" (OFN As tagOPENFILENAME) As BooleanDeclare Function aht_apiGetSaveFileName Lib "comdlg32.dll" _ Alias "GetSaveFileNameA" (OFN As tagOPENFILENAME) As BooleanDeclare Function CommDlgExtendedError Lib "comdlg32.dll" () As LongGlobal Const ahtOFN_READONLY = &H1Global Const ahtOFN_OVERWRITEPROMPT = &H2Global Const ahtOFN_HIDEREADONLY = &H4Global Const ahtOFN_NOCHANGEDIR = &H8Global Const ahtOFN_SHOWHELP = &H10' You won't use these.'Global Const ahtOFN_ENABLEHOOK = &H20'Global Const ahtOFN_ENABLETEMPLATE = &H40'Global Const ahtOFN_ENABLETEMPLATEHANDLE = &H80Global Const ahtOFN_NOVALIDATE = &H100Global Const ahtOFN_ALLOWMULTISELECT = &H200Global Const ahtOFN_EXTENSIONDIFFERENT = &H400Global Const ahtOFN_PATHMUSTEXIST = &H800Global Const ahtOFN_FILEMUSTEXIST = &H1000Global Const ahtOFN_CREATEPROMPT = &H2000Global Const ahtOFN_SHAREAWARE = &H4000Global Const ahtOFN_NOREADONLYRETURN = &H8000Global Const ahtOFN_NOTESTFILECREATE = &H10000Global Const ahtOFN_NONETWORKBUTTON = &H20000Global Const ahtOFN_NOLONGNAMES = &H40000' New for Windows 95Global Const ahtOFN_EXPLORER = &H80000Global Const ahtOFN_NODEREFERENCELINKS = &H100000Global Const ahtOFN_LONGNAMES = &H200000Function TestIt() Dim strFilter As String Dim lngFlags As Long strFilter = ahtAddFilterItem(strFilter, "Access Files (*.mda, *.mdb)", _ "*.MDA;*.MDB") strFilter = ahtAddFilterItem(strFilter, "dBASE Files (*.dbf)", "*.DBF") strFilter = ahtAddFilterItem(strFilter, "Text Files (*.txt)", "*.TXT") strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*") MsgBox "You selected: " & ahtCommonFileOpenSave(InitialDir:="C:", _ Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags, _ DialogTitle:="Hello! Open Me!") ' Since you passed in a variable for lngFlags, ' the function places the output flags value in the variable. Debug.Print Hex(lngFlags)End FunctionFunction GetOpenFile(Optional varDirectory As Variant, _ Optional varTitleForDialog As Variant) As Variant' Here's an example that gets an Access database name.Dim strFilter As StringDim lngFlags As LongDim varFileName As Variant' Specify that the chosen file must already exist,' don't change directories when you're done' Also, don't bother displaying' the read-only box. It'll only confuse people. lngFlags = ahtOFN_FILEMUSTEXIST Or _ ahtOFN_HIDEREADONLY Or ahtOFN_NOCHANGEDIR If IsMissing(varDirectory) Then varDirectory = "" End If If IsMissing(varTitleForDialog) Then varTitleForDialog = "" End If ' Define the filter string and allocate space in the "c" ' string Duplicate this line with changes as necessary for ' more file templates. strFilter = ahtAddFilterItem(strFilter, _ "Access (*.mdb)", "*.MDB;*.MDA") ' Now actually call to get the file name. varFileName = ahtCommonFileOpenSave( _ OpenFile:=True, _ InitialDir:=varDirectory, _ Filter:=strFilter, _ Flags:=lngFlags, _ DialogTitle:=varTitleForDialog) If Not IsNull(varFileName) Then varFileName = TrimNull(varFileName) End If GetOpenFile = varFileNameEnd FunctionFunction ahtCommonFileOpenSave( _ Optional ByRef Flags As Variant, _ Optional ByVal InitialDir As Variant, _ Optional ByVal Filter As Variant, _ Optional ByVal FilterIndex As Variant, _ Optional ByVal DefaultExt As Variant, _ Optional ByVal FileName As Variant, _ Optional ByVal DialogTitle As Variant, _ Optional ByVal hwnd As Variant, _ Optional ByVal OpenFile As Variant) As Variant' This is the entry point you'll use to call the common' file open/save dialog. The parameters are listed' below, and all are optional.'' In:' Flags: one or more of the ahtOFN_* constants, OR'd together.' InitialDir: the directory in which to first look' Filter: a set of file filters, set up by calling' AddFilterItem. See examples.' FilterIndex: 1-based integer indicating which filter' set to use, by default (1 if unspecified)' DefaultExt: Extension to use if the user doesn't enter one.' Only useful on file saves.' FileName: Default value for the file name text box.' DialogTitle: Title for the dialog.' hWnd: parent window handle' OpenFile: Boolean(True=Open File/False=Save As)' Out:' Return Value: Either Null or the selected filenameDim OFN As tagOPENFILENAMEDim strFileName As StringDim strFileTitle As StringDim fResult As Boolean ' Give the dialog a caption title. If IsMissing(InitialDir) Then InitialDir = CurDir If IsMissing(Filter) Then Filter = "" If IsMissing(FilterIndex) Then FilterIndex = 1 If IsMissing(Flags) Then Flags = 0& If IsMissing(DefaultExt) Then DefaultExt = "" If IsMissing(FileName) Then FileName = "" If IsMissing(DialogTitle) Then DialogTitle = "" If IsMissing(hwnd) Then hwnd = Application.hWndAccessApp If IsMissing(OpenFile) Then OpenFile = True ' Allocate string space for the returned strings. strFileName = Left(FileName & String(256, 0), 256) strFileTitle = String(256, 0) ' Set up the data structure before you call the function With OFN .lStructSize = Len(OFN) .hwndOwner = hwnd .strFilter = Filter .nFilterIndex = FilterIndex .strFile = strFileName .nMaxFile = Len(strFileName) .strFileTitle = strFileTitle .nMaxFileTitle = Len(strFileTitle) .strTitle = DialogTitle .Flags = Flags .strDefExt = DefaultExt .strInitialDir = InitialDir ' Didn't think most people would want to deal with ' these options. .hInstance = 0 '.strCustomFilter = "" '.nMaxCustFilter = 0 .lpfnHook = 0 'New for NT 4.0 .strCustomFilter = String(255, 0) .nMaxCustFilter = 255 End With ' This will pass the desired data structure to the ' Windows API, which will in turn it uses to display ' the Open/Save As Dialog. If OpenFile Then fResult = aht_apiGetOpenFileName(OFN) Else fResult = aht_apiGetSaveFileName(OFN) End If ' The function call filled in the strFileTitle member ' of the structure. You'll have to write special code ' to retrieve that if you're interested. If fResult Then ' You might care to check the Flags member of the ' structure to get information about the chosen file. ' In this example, if you bothered to pass in a ' value for Flags, we'll fill it in with the outgoing ' Flags value. If Not IsMissing(Flags) Then Flags = OFN.Flags ahtCommonFileOpenSave = TrimNull(OFN.strFile) Else ahtCommonFileOpenSave = vbNullString End IfEnd FunctionFunction ahtAddFilterItem(strFilter As String, _ strDescription As String, Optional varItem As Variant) As String' Tack a new chunk onto the file filter.' That is, take the old value, stick onto it the description,' (like "Databases"), a null character, the skeleton' (like "*.mdb;*.mda") and a final null character. If IsMissing(varItem) Then varItem = "*.*" ahtAddFilterItem = strFilter & _ strDescription & vbNullChar & _ varItem & vbNullCharEnd FunctionPrivate Function TrimNull(ByVal strItem As String) As StringDim intPos As Integer intPos = InStr(strItem, vbNullChar) If intPos > 0 Then TrimNull = Left(strItem, intPos - 1) Else TrimNull = strItem End IfEnd Function'************** Code End *****************
In a record, I want to have a text box which displays the file path to a .pdf or .doc, docx file. If you double click in the text box the file within the text box opens. If there is no file path I want a small command button to be visible next to the text box, which will launch an explorer that will locate and save the path of a chosen .pdf or .doc, docx file.
I have a field within a tblPriceList called quotefile, which I want to store the file path.
For info. This is not going to be a major multi user database, but the quote files will be stored on a vserver, not the PC the DB is being used on.
I want to open the 'Save Backup As' Dialogue Box from the file menu, using a Command Button on a Form in Access 2003.I know you can do this manually but I would love to do it programically.
We have Cardiac Rehab patients that come 3 times a week (M-W-F). Once they are on program they stay there for 3 months. There are classes given hourly from 8am thru 6pm. There are 12 available slots per class. Right now this is being handled in Excel, but I thought I might improve things by putting it in Access.
The Excel "form" I built has fields for PatientName, MedicalNotes, DoctorName, and Notes. Because the names rarely move (a patient gets a slot and stays there) the user opens Excel, reviews the form to make sure no one cancelled-is out sick-etc, then prints the schedule. When the day is complete I have a macro that takes this information and saves it in a tablelike manner on another sheet. A dynamic pivot table references this info to give the user quick answers as to daily volume, etc.
The thing I can't get my head around is how to make this as easy in Access. My thought was I could have a PatientT, listing all of the fields mentioned above. I could have DailyF open, bound to PatientT, with additional unbound textboxes to add "today's date", cancellations or no shows, and then Save all of this in another table and print out the daily schedule.
Under Current Database, I have "Overlapping Windows" checked. When I open a table, it opens to pretty wide. Then I resize it so that it takes up less space. After resizing, whether I click Save or not, after closing, then reopening the same table, it opens back to its original size (very wide), instead of opening at the smaller size that I resized the table to.
Is it possible to resize a table, and get it to open at that size next time you open that particular table?
I have created single form and 7 different tables. In my form I have a combobox which have different branch names (Table names are as per combobox values). Now what i want to do is whenever I select a branch name from combo box and click on the save command button the particular record should be saved in particular table.
One of my tables has a couple of OLE Object fields. This has embedded Word, Excel, and PDFs. I'd like to know if there is a way to export these to a folder. Ideally, I'd like to save them with the record id and then a dash and then the file.
The fields are Attachment1, Attachment2, and Attachment3
When I view the table for these fields, if it's a word doc all I see is "Microsoft Word Document".
I have created a small database, and created a Main Menu (form), the main menu starts as soon as someone start my database, i have linked up all my forms & reports into this main menu. now i want to hide left panel bar that shows all the table, quires, forms & reports files (so nobody can access tables, quires, etc from that panel).
So I have this relatively simple problem: I need to create a button that once clicked will open the Save As dialog box and allow the user to save a copy of the current database where he wishes. The filename should contain todays date in DDMM format along with some pre-set text e.g. DDMM PresetText.
Let's say that there're 2 workers: Worker A, and Worker B, and they are fixing some engines. There's 2 different engines: Engine A, and Engine B. And these workers are fixing these engines for all day, and in the evening they have to register how many engines they've fixed.
And my job is to design Access database for them. I thought it will be very easy to do; I've created table with columns: Date, Worker, Engine, Quantity - so every day Worker A and Worker B can register, that they have repaired some amount of Engines A and Engines B.
But there's a problem that I also have to register how many Engines have arrived to the factory, and how many of them weren't repaired on time (E.g. 15 Engines A have arrived, Worker A fixed 5, Worker B fixed 5 so there's 5 engines left for tomorrow)
I've figured out that I should somehow create table IncomingEngines with columns Date, Engine, Incoming, Fixed, Undone (field Fixed should be completed automatically every day for every engine - it would be a sum of engines A and engines B fixed by worked A and worker B - so I could fill Incoming field manually)
It's easy to create this kind-of Query, but I can't add column to querry, or edit it.
i have a table with a date field with default value for new records date() when i change an other field and im going to save the changes access says that canntot save the changes because of unknown type date()....
I have a few selected reports on an Access 2007 database that users can run. Is there a way for users to view the report, save as a PDF and automatically save a copy to a shared drive by modules/vba coding as an On Click event procedure?
Okay, I've been working on this database for weeks now, I'm almost done, there is a light at the end of the tunnel and my boss is anxious to implement the db as I'm only here for 3 more weeks and it MUST be completed, tested, error checked before I leave. So I'm running out of time FAST!
Okay, the problem is simple. I'm using a Data Access Page in Access to build a nice little front-end for my database for my co-workers to use. On this DAP (Data access page) I have an Input box that allows the users to browse their directory and select a file. I need to take the path/file name that pops up in the input box and just save it to the table. I can take care of all the other elements.
So, through DAP, how do I save the value in the inputbox into my table. Please, any help would be great! :eek:
Hi Guys, What i am trying to do is, i have two tables called Table1 and Table2.
I have created a form called Form1. This Form1 has all the fields from Table1.
What i want to do is, as soon as a user fills in the details in Form1, obviuosly it saves those details in Table1, BUT i want it to save a couple of field values into Table2 as well.
How do i go about doing this??
In Table1 i can access the fields by "Me.[Fieldname]" (from the VB script), but how do i access Table2 OR how do i save data to Table2 from Form1.