Access Selected Record Ouput To Word

Jan 15, 2008

Hi all!

I am new to the scene, please forgive me if my question or language seems silly

I have this Access 2000 database filled with over 1500 records of people
I need to send these people letters based on their age and gender

I guess I would normally do the gender thing with a mergefield in Word, it'll simply create "Madam" or "Sir" upon an if...then instruction on genderdata in the database. The problem is, there's not two, but there's three options! I'll explain below.

The first option is for kids < 12 y
The second option is for kids > 12 but < 18 AND their parents
The third option is for adults (>18)

So, in fact there's three letters.

Now, what I need a code -or at least the concept- that will tell the database to select and open the right letter by pressing a button in a form.

I can of course make three hyperlinks in the form, one for each letter, and let the user choose, but that's not too fancy is it?

I want the database to make the choice. So, I guess in normal language the instruction needs to select the current record, analyse the age (date-dob) and, depending on the result of that calcultion, it needs to open the correct document in Word.

But here's the point: I'm quite unfamiliar with VBA code

But maybe even a conceptual answer might help!

Thanks in advance!

Arjan, The Netherlands

View Replies


ADVERTISEMENT

Remember The Selected Record - Requery - Then Go Back To Selected Record...

Jun 28, 2005

Hi guys,

Bit of a problem I'm hoping someone can help with. I have a telephone call logging system. The system is a tabbed form with each tab representing a person's Telephone Call Inbox. As new calls are entered into the database, they appear in each person's inbox until they are marked as dealt with.

This all works fine and there are no problems with the basics of it, but the problem I do have is that after I have split the database into a Back end and a Front end and distributed the Front ends to each user, when a new call is entered it doesn't appear in the persons inbox until they do a requery.

At first I sent the form to requery using the ontimer event, but the problem I have is that after every reqery the form goes back to the first record. A user on the office forum suggested I use the following code:

vCurrent = Me.Bookmark
Me.Requery
Me.Bookmark = vCurrent

But this gives me invalid bookmark errors, so I was then told to add

On Error Resume Next

But this stops the bookmark function working and instead the first record is loaded every 1 minute (as set by my timer).

Can anyone recommend a better way that actually works without invalid bookmark errors?

View 14 Replies View Related

Access Record Exporting Into Word Documents

Jan 25, 2008

I was wondering if there is an awesome way out there somewhere to take a record and export it into a word document, like a template and have the fields go where you want them to?

View 13 Replies View Related

Forms :: Access 2010 The Same Record Be Selected In Each List Box Within The Form With Tabs

Sep 21, 2013

I have a form with 3 tab controls. Within each tab, there is a bound list box that lists records based on a combo box selection. All list boxes are bound to the same table and records in each tab will be in the same order.

Tab1, listbox1:Field1, Field2, Field3, Field4
Tab2, listbox2, Field1,Field2, Field5, Field6
Tab3, listbox3:Field1, Field2, Field7, Field8,Field9

I would like the same record be selected in each list box within the tabs, e.g. when record #2 is selected on tab1, the same record will be selected on tab2 and tab3, or if I click on tab 2 again and change the selection to record #3, record #3 will be selected on tab1 and tab2.

View 3 Replies View Related

Forms :: Double Click Event - Form Showing 1st Record Instead Of Selected Record

May 8, 2014

I am new to access and I recently encountered a double click issue

My form loads perfectly on double click event but it shows the first record instead of selected record.

My search is based on a PersonID but each PersonID has different WorkID that I wish to display on double click but it always shows the first WorkID instead of my selected record

I have tried changing the filters in the form properties but it still doesn't work for me.

Here's my code:

Private Sub SearchResults_DblClick(Cancel As Integer)
DoCmd.OpenForm "WorkForm", , , "[PersonID]=" & Me.[Searchresults], , acNormal
End Sub

[Searchresults] draws information from my Query

Query information:

PersonID... WorkID... Type......Location
1234..........1............Paint .....Address A
1234..........2............Electric...Address B
1234..........3............Floor..... Address C

View 7 Replies View Related

Record Cant Contain The Same Word, How?

Jan 4, 2007

Im new here so Hi!My name is jitze de wilde. Im from the netherlands. Im 21. I work at www.visualmedia.nlOn my current asignment im collecting data on all the business in the local area.I aquired alot of information and there are bount to be duplicates. now my question. Is there a way in Access to fish out duplicate items or records (dont know the name)?example:I enter the following data.Kreeft Holding B.V.Agarica B.V.S.I.T. Controls B.V.Robatechniek B.V.Mannak Techniek B.V.Kip Caravans B.V.Van Venrooy B.V.Robatechniek B.V.In the list Robatechniek B.V. exists twice. Is there a way access will prompt a message "item already exists" or something like that?

View 7 Replies View Related

Printing Selected Record

Jul 15, 2005

I'd like to put a command button on a form that would run a designated report but have the option of only printing selected records. I know I could just use the File/print option using selected records but that only prints the record fields displayed in the form. I want to run a special report that formats and prints more of the records fields. The problem is how have that report print the "currently selected" record or records.

Thx.

View 4 Replies View Related

How To Get Selected Record Value From Subform

Mar 3, 2015

I am trying to put in code in the Exit event of the subform to get the value of the selected row. I have been able to get the selected row using ".Current Record" but am not able to get the row value using it. Say, the subform fields are Id, Name and Address and I want to show the value of Address for the selected row in a msgbox.

View 2 Replies View Related

Exporting A Selected Record To Text

Apr 21, 2005

Ok I have a db that list stats for many of NFL's Great players. I have created a form with a drop down combobox that list the players. The rest of the form displays the stats for that player. I have linked two forms with a command button. I was hoping that I could use another command button in combination with a macro that would allow me to send (just the displayed record) to a text file. I have tried using a macro with OutPut To but it sends the entire table to text.....Please Help Me I have been working on this for Two DAYS...... :eek: HELP!!!!

View 1 Replies View Related

Combo Box Updating By Selected Record

Feb 24, 2006

Hi all,

I have created a form to enter downtime information using the fields from downtime table (as follows)

tblDowntimes

fldDowntimeID (PK)
DateOccured
MaterialCode
ShiftID (FK)
LineMachineID (FK)
DTCategoryID (FK)
DTReasonID (FK)

However on the form, LineMachine is taken from the tblLineMachine where LineID and MachineID are FKs. This has a large list of machines as one line can have many machines and a machine may appear on more than one line

So on the form, i would like to select the LineMachineID by inserting fldLineID (which would be a combo box) where the user could select which line e.g. Line1 and then the combo box for the LineMachineID would only display the relevant machines for the entered line instead of all the machines for every line.

I managed to achieve this,but I am experiencing a problem where if, in the Line combo box, i choose a different Line e.g. Line2, the LineMachineID does not then display the machines on Line2, but keeps showing the machines for the line I originally selected (Line 1).

How do I get the LineMachineID combo box to update every time a different line is chosen in the LineID combo box?

Any assistance much appreciated!!

thanx all,

Keji

View 3 Replies View Related

Macro Help Displaying One Selected Record

Nov 8, 2004

I am trying to create a table of help messages and display them help in a form. Using MSAccess.

Each Form used will have a help button, that runs a macro "mcrHelp.xxxxx". This macro should select the relevant record from the table to display in the "Help Form".

But i am having problems selecting the records.

Ex.
Macro name: mcrHelp.Help1
Table name: tblHelp
Fields: HelpId HelpTitle Description1 Description2
Data: 1 Help1 Sentence 1 Sentence 2

Form to display help in: frmHelpScreen

I want mcrHelp.Help1 to select the Help1 record from tblHelp and display Sentence 1 and Sentence 2 in the form frmHelpScreen.

Each time i try the macro i have i get the first record displayed in the form.

Many thanks

View 1 Replies View Related

I Want To Open A Form To A Selected Record.

Mar 20, 2008

I have a form that updates records. When the user opens the form in data entry mode, it is too difficult to find the correct record. What is the most efficient and simple way to have the form open to a specific record?

Solutions I have considered are a popup form that the user will enter the equipment code (which is the unique identifier of all records). Also, the user may not know the record number, but they will always know the equipment code (which is a field in the "equipment" table).

But I am not sure of the best way/best order to do this.

Thanks.

View 14 Replies View Related

What Does Circle With A Line Through It Next To Selected Record Mean

Jan 14, 2015

User asked why the circle with a line through it appears next to a selected record. We've been having network connectivity issues and the db is stored on the network. Is the symbol and the network issues related?

View 2 Replies View Related

Duplicating Record With Selected Fields Only

Mar 28, 2015

Is it possible to duplicate a record with selected fields, to be copied into a new record. ie if there are 10 fields, i only need 8 of them (no need for timestamp field etc form existing record).

View 1 Replies View Related

Send Record To Word Document

Jun 8, 2007

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))

If Me.chkDeliverYard = False Then

.ActiveDocument.Bookmarks("ClientName").Select
.Selection.Text = (CStr(Forms!frmOrderDetails!ClientName))
.ActiveDocument.Bookmarks("SiteReference").Select
.Selection.Text = (CStr(Forms!frmOrderDetails!SiteReference))
.ActiveDocument.Bookmarks("SiteAddress1").Select
.Selection.Text = (CStr(Forms!frmOrderDetails!SiteAddress1))
.ActiveDocument.Bookmarks("SiteAddress2").Select
.Selection.Text = (CStr(Forms!frmOrderDetails!SiteAddress2))
.ActiveDocument.Bookmarks("SiteAddress3").Select
.Selection.Text = (CStr(Forms!frmOrderDetails!SiteAddress3))
.ActiveDocument.Bookmarks("Town").Select
.Selection.Text = (CStr(Forms!frmOrderDetails!Town))
.ActiveDocument.Bookmarks("City").Select
.Selection.Text = (CStr(Forms!frmOrderDetails!City))
.ActiveDocument.Bookmarks("Postcode").Select
.Selection.Text = (CStr(Forms!frmOrderDetails!Postcode))

Else

.ActiveDocument.Bookmarks("ClientName").Select
.Selection.Text = "OUR YARD"
.ActiveDocument.Bookmarks("SiteReference").Select
.Selection.Text = ""
.ActiveDocument.Bookmarks("SiteAddress1").Select
.Selection.Text = ""
.ActiveDocument.Bookmarks("SiteAddress2").Select
.Selection.Text = ""
.ActiveDocument.Bookmarks("SiteAddress3").Select
.Selection.Text = ""
.ActiveDocument.Bookmarks("Town").Select
.Selection.Text = ""
.ActiveDocument.Bookmarks("City").Select
.Selection.Text = ""
.ActiveDocument.Bookmarks("Postcode").Select
.Selection.Text = ""

End If

'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

End With


Exit Sub
**** END OF CODE****

View 4 Replies View Related

Setting A Combo To The Record Selected In A Form

Feb 8, 2005

Hello,

I suspect this is probably rather easy, but I've not been able to figure it out:

I am using a combo to select a record in a form. This works.

The problem is: When I navigate through the records in the form, the combo box does not "update". I need to be able to change the record displayed in the combo box as the record in the form changes.

Any ideas?

Many thanks in advance for assistance.

View 8 Replies View Related

Changing Display Based On Record Selected

Jan 26, 2006

I'm this is a simple issue. I have a combo box which can have the following status's: Not Started, In Progress, Complete. Depending on the value of the combo box i want a different image to show. So if not started is selected i want the user to see a red box. If Complete is chosen, a green box will show. i can do this easily enough but my problem comes in when i go to the next record. The boxes just stay visible regardless of what option is displayed. What event is triggered when you go to the next form?? Form Open / Load doesnt seem to work.
:mad:
:confused:

View 2 Replies View Related

Open Form To Selected Record From Listbox

Dec 13, 2006

Yet another question.

I have a listbox on a form that show all Files for a particular volunteer. I have an "Edit File" button below the listbox to be able to edit that particular file. Is there a way about opening that form to that specific record without using a query?

Thanks
ScrmingWhisprs

View 12 Replies View Related

Open A Record In A Form When Selected From List Box

Jan 19, 2005

Hi folks,

I have created a form, which extracts records from a table and displays them in
a list box. This works, but what I want to do next is highlight a single record in
that list box, click a button and have the record open in another form. This is
the code I have at present:

Private Sub DisplayEnquiry_Click()
On Error GoTo Err_DisplayEnquiry_Click
Dim dispCriteria As String

dispCriteria = "[SupportEnquiriesTable].[EnquiryID]='" & Forms![Search All].[ListSearch].Column(0) & "'"
DoCmd.OpenForm "Support Enquiries", , , dispCriteria
Exit_DisplayEnquiry_Click:
Exit Sub
Err_DisplayEnquiry_Click:
MsgBox Err.Description
Resume Exit_DisplayEnquiry_Click

End Sub

When I try this I get an error "The OpenForm action was canceled. You used a method of the DoCmd
to carry out an action in Visual Basic, but then clicked Cancel in a dialog box."

I've double-checked that I've typed in the correct names etc. so I am at my wits end!
Can anybody help me out?
Thanks

View 1 Replies View Related

Forms :: Splitform View - No Record Selected

Mar 7, 2013

Access 2010

I have a bound form (splitform view) with the code

"DoCmd.GoToRecord , , acLast"

on the Form_Open event. When I open the form it does go to the last record and shows all the data that are in (some of the) fields. I cannot however manipulate the record until I click on the navigation buttons in the bottom of the form. It also doesn't show which record ("34 of 34" for example) is selected.

How I can get it to open the last record and let me manipulate it directly on open?

View 4 Replies View Related

Reports :: Getting Report To Print Only Selected Record Instead Of All

Aug 10, 2015

I am trying to get a report to print out one one record that I want.. I want it to be able to be sorted by date and the user just picks a date and one record is printed out on page. Right now every record that is stored is being printed on a different page and over time that is going to be a lot of paper... I want to be able to pick which record I want printed...

The Form is called "Bread Mold"
The report is called "Bread Mold Report"
The table is called "Bread Mold"
What it is sorted by is called "Swab Date"

View 13 Replies View Related

Starting Datasheet View At Selected Record

Oct 13, 2011

I have a simple form in datasheet view in Company Name sequence. By default it starts the list at the beginning. I would like to put a combo box in the form header that pulls down the companies to allow the user to select the starting company to list. I don't want to go directly to the selected company, I just want the list to populate starting with the selected company. I can create the combo box and I know I use the After Update event to get the selected value, but how do I restart the list. Ideally, I would still like the operator to be able to scroll up and down after the list is redisplayed starting with the selected company.

View 2 Replies View Related

Open A Form With A New Record With Selected Info Already Filled In

Sep 29, 2006

Hi again,

One last one that's been niggling me - I just can't fathom the code... I bet it's very simple...

I have a Form ("frmJobSummary") that shows all the jobs for a customer - the customer is selected and the Customers ID is stored in a Control called "CustomerID" (It's just a number)

I have a button that opens up a new form... "frmEditJob" This allows you to add a job to a customer. I know how to get it to open up as a new record... but...

How do I get it to open up as a new record (or job) for the customer selected on the form "frmJobSummary"?

Here's the code so far... all it does is open the form with the Current record. :(

Your help is, as always, most appreciated!

Private Sub OpenNewJob_Click()
On Error GoTo Err_OpenNewJob_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmEditJob"

stLinkCriteria = "[CustomerFK]=" & Me![CustomerID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_OpenNewJob_Click:
Exit Sub

Err_OpenNewJob_Click:
MsgBox Err.Description
Resume Exit_OpenNewJob_Click

End Sub

View 3 Replies View Related

Modules & VBA :: Delete A Selected Record In A Subform By Using A Button

Jan 12, 2014

For school I have to make a application in access how to delete a selected record in the table in a subform by using a button. The subform is in the main form and the button is also in the main form

View 14 Replies View Related

Reports :: Filter Records After Selected Record Combo Box

Sep 2, 2013

i have a combo box, which looks up a list of school names from my main table. The user selects the desired school, then clicks the button underneath, which opens a report. What i want the report to show is the next 31 (that is how many fit on one page) schools AFTER the school that the user selects - the underlying query for the report has them in alphabetical order. There are ~250 schools in the list.Even if i can get it just to display the records after the selected one on the form, that would be fine.

View 4 Replies View Related

Forms :: Combo Box With Msgbox If Selected Item Is Not In Record

Oct 30, 2014

I want a Messagebox to be appear if the selected item or if the input item in the combobox was not in the record.

I used this condition in combobox

="[asstnumbr] = " & "'" & [Screen].[ActiveControl] & "'"

but when I try this run code function in macro via IFF will become error

IIf([asstnumbr]<>"'" & [Screen].[ActiveControl] & "'",MsgBox("NO RECORD FOUND IN YOUR SEARCH"))

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved