I'm trying to add hidden information to a record and need to know the best way to do it.
I have a visible table that all users enter data into using a form.
I also have a hidden table that contains 2 fields "linked Table ID" and "notes"
I have a box at the top right of my form which is white (I also have a white background so it's impossible to see).
When you click the box it changes a textbox on my form visible property from false to true.
then I plan to use a separate button that the user currently uses to save a record to store ID number and hidden textbox information in the hidden table but I'm sure how to do this.
Finally I will use a hidden query which will display all the fields from both tables using the linked Table ID from the hidden table and ID field from the non hidden table.
So i have 2 questions:
1 how do I save information the user entered into a form created from one table into a different (hidden) table
I'm very new to access so I'm not sure about the correct way to go about this. I have a table with a 'category' column, a form which hides the category column, and a combobox to filter the category, let's say R, C, and F.
What I want accomplish is to have the value of the comobox applied to the hidden 'category' column when a user enters a new record into the form.
Is there I way I can get an instance to the record as it's being entered and modify the data using VB? Or would I have to write a sort of pop() function and have it run afterInsert and then modify it that way? Can I even alter the table using VB like this?
I'm using the MS Access 2010 ExportwithFormating action to export three tables to a single MS Excel 2010 workbook. The action overwrites the first excel worksheet each time instead of saving all three worksheets in a single excel workbook.
How can I export three tables into a single excel workbook.
I have a situation where two clients will be using the same database design - one of them will be sending information from his database for the other client to add to their database.
This will be on a record by record basis. The form that has the info entered into it also has a subform.
How do I export a single record between databases that have the same fields? I know how to export a table, but not a single record. The fact that the record that needs to be sent is from two tables (ie the main form and the subform that collects the data for those tables) further complicates things for me. Any ideas? :eek:
Private Sub jobdatebox_GotFocus() Dim dteFormDate As Date dteFormDate = CDate(InputBox("Enter the date:", "Date Entry")) Me.jobdatebox.SetFocus Me.jobdatebox.Text = dteFormDate
the above code pops up an alert and asks the user to enter a date. this value is then stored in the jobdatebox control (jobdate field)
the jobdate field is a Date/Time datatype and is the first item on my form so when the form opens this pop up appears instantly (which is fine)
they enter a date as the following: 6 6 and it displays as 06/06/2006
my user tabs through the fields, inserting a record.. when they reach the last field.. and tab again (to enter another record)
the pop up alert appears again..i dont want this.. i only want it to pop up the first time (when the form is opened) and then just keep that value in the jobdatebox for the remainder of the form's open session
i need something that does the following..
on new record creation jobdatebox.value = dteFormDate (the value entered previously)
OR
Private Sub jobdatebox_GotFocus() Dim dteFormDate As Date dteFormDate = CDate(InputBox("Enter the date:", "Date Entry")) Me.jobdatebox.SetFocus Me.jobdatebox.Text = dteFormDate for all records entered until form closes
OR
just before new record is created if jobdatebox = not null (has a date value inside already) then newrecord.jobdatebox = previous record jobdatebox.value
OK - bit of a newbie here & maybe this question has been asked a thousand times but i can't find any answers that cover this question properly.
Basically i am writing an access database that stores contract information, contact details, orders etc etc. I want to take the Order Number field, along with the Client Name & Address etc and post it into a Word Mail Merge type document, then save that file as ordernumber.doc after checking to see whether it already exists.
I have successfully managed to send the information into word in a mail merge document & get it to save the file using the ordernumber.doc format, however it is saving it to mydocuments folder and i want it in a subfolder called orders (that does exist). It is also not checking to see if that file already exist and overwrites it if it does.
I want to change the path to where the file is being saved, check whether it exists already, then ask me whether i want to overwrite it or save as something else.
Any help would be most appreciated. BTW I am using Word & Access 2003.
*****THIS IS THE CODE I AM USING***** Private Sub NewEternit_Click() On Error GoTo NewEternit_Err
Dim objWord As Object
'Start Microsoft Word. Set objWord = CreateObject("Word.Application")
With objWord 'Make the application visible. .Visible = True
'Open the document. .Documents.Add ("\shentcDocuments and SettingsJohn.SHENTMy DocumentsTemplatesEternit Order Merge.dot")
'Move to each bookmark and insert text from the form. .ActiveDocument.Bookmarks("orderno").Select .Selection.Text = (CStr(Forms!frmOrderDetails!ContractNo) & "/" & (Forms!frmOrderDetails!OrderNo)) .ActiveDocument.Bookmarks("Date").Select .Selection.Text = (CStr(Forms!frmOrderDetails!Date))
'Print the document in the foreground so Microsoft Word will not close 'until the document finishes printing. 'objWord.ActiveDocument.PrintOut Background:=False
' Save the file using orderno field Dim FName As String FName = Forms!frmOrderDetails!OrderNo & ".doc"
'Quit Microsoft Word and release the object variable. 'objWord.Quit 'Set objWord = Nothing
I would like to be able to place a button on my invoice form that will allow me to e-mail the individual invoice to the person being billed (the e-mail address is included on the form). I created a macro that works to send a PDF file of all of the records and I am having trouble figuring out how to send just the current record. I would also like to have the e-mail address automatically populated based on the e-mail address on the current record.
What I'm try to do is attach any files from the attachment field from the current open record to email i have some code i have manage to get files from the open record to save to destination /temp folder to work so outlook can attach the files but outlook is not opening or putting them in to email also have problem's that i have highlighted in the code in red.
Code: Private Sub cmdEmail2_Click() Dim outlookApp As Outlook.Application Dim outlookNamespace As NameSpace Dim objMailItem As MailItem Dim objFolder As MAPIFolder Dim strAttachementPath As String
I've created a button on my ACCESS 2010 form that will send a PDF via email. However I only need to send the single record displayed on the form not all records.
The on click command of the button sends the PDF of the report. (I read that this is what should be sent; but still get the same results.)
I don't understand how and where to attach VBA code:
I have 2 form, form1 and form 2 (picture attached)
In Form 1 (main form) there are "reference" field with key pressed event then call form 2 (list of reference that user can choose)
In form 2 the problem is, when "enter" key pressed (keypress event), selection will move to next record so the data that transferred to form 1 is wrong (next record)
The question is : how to save current record in form 2 before enter and send the data to form 1
HI: I've managed to export multiple linked tables to XML via the Export feature in Access. In looking at the XLM that is generated, I notice that the data that corresponds to the key field contains the key that is autogenerated. If, for example, I look at the last table in the chain, and look at the foreign key field, it contains the key number of the table that it is linked to (as it should). My question is: is there a way to have this key value inserted in a relative (referential?) format rather than an absolute format?
For example, If the foreign key (e.g. #5) in table 'B' points to primary key 5 in table 'A', instead of having '5' in the field ID_my_key,
e.g.: <Table>A</Table> <ID_my_key>5</ID_my_key> I could have something like: TABLE A.5. <Table>A</Table> <ID_my_key>A.5</ID_my_key>
I am looking for this feature because I need to take a set of objects that are arranged in a hierarchial manner in the data base and import a subset of that information (keeping the hierarchial information in tact) into another tool.
I guess I could write some code to walk the structure and construct the references but that would be some additional work that I really don't have time for at the moment. Any help/pointers on how to do this is appreciated. -John
I was wondering if anyone might be able to help me here. I was trying to write up a technical report for the Access database i built. Are there an easy way of exporting all the tables with their attributes in Access?
For example, in the student table, ID FirstName LastName ...
I have created about 7 tables in Access, which all have the same column names. I want to export all of the table's data at the same time into a Excel SpreadSheet using VBA.
Also I want specify where i want the data to go in the SpreadSheet e.g. All data will be exported to cell A4.
I created a table with an older version of MS Access which was replaced with Access 2010. I was able to export the table simply by selecting specifications that I created.
How do I export with these same specifications in Access 2010 ?
This works - but FIRST I get an error 91 on the first line here stating that the Object variable or With block variable is not set. It lets me debug the code as it's running, showing me the highlighted first line in error. I then click the Continue button in the code window and all the rest of the code executes fine.
How do I get past that first error? And why is it letting me continue afterwards without addressing the error?
If I do a On Error Resume Next, it doesn't fill the boxes with data or issue the Click event command.
From MS Access, I want to export my files to MS excel. However, i want to allow the user to open up windows file browser to select the folder n filename. Any advice on how can i go about coding this?
I would like to export each record of an access table to a separate text file and use one field of each record as the source for the file name of each exported text file. Does anyone know a way of dong this?
I have a form from with a button that exports data in to excel using the following on click code DoCmd.OutputTo acOutputQuery, "qrySoftPDR2", acFormatXLS, "FOBPDR.xls", True 'open in Excel The problem is that if I go in to an existing record it works fine. However if I have just input the record then it comes out blank. I'm guessing there is some sort of record update code I can use, but I've been unable to figure oput what it may be,