Open Saved File Based On Form Textboxes

Feb 1, 2006

Hello all,

Do you have a code that would open a saved file based on the contents of 2 textboxes on my form.

The saved files would be in:
C:Documents and Settings100310257Desktop

I have a button on the form, but need a code that would pull up the savedfile using the name in textbox1 and the name in textbox2, like this:
textbox1-textbox2. e.g. textbox1 = Novo Group. textbox2 = AA
There is a saved file in the path above, Novo Group-AA

Thanks for helping!

View Replies


ADVERTISEMENT

Reports :: Prompt Before Overwriting A Saved File

May 15, 2015

The code below successfully saves a .pdf file to my c: drive. However, on occasion i want to overwrite a previously saved invoice e.g. 3815-140515-Bristol with an amended invoice but retain the same Invoice Number e.g. 3815-150515-Bristol.

Currently, if i save the invoice with the same invoice number but a different date it just saves down without overwriting the original invoice. Leaving 2 invoices with the same invoice numbers but with 2 different dates.

What I want to achieve is: Once I hit the SaveInvoice button the code will check that invoice Nr 3815 does not exist in c: drive and save normally. However, if it does exist a msgbox will then prompt me to overwrite.

Current code:

Private Sub SaveInvoice_Click()
'Save Invoice as PDF and annotate invoice number, site name, and date
Dim slFileName As String
' create the invoice as a pdf
slFileName = Me.txtInvoiceNr.Value & "-" & Format(Date, "ddmmyy") & "-" & Me.SiteName.Value & ".pdf"

DoCmd.OutputTo acOutputReport, "rptinvoice", acFormatPDF, ("c:CompanyName InvoicesRegular Invoices" & slFileName)

MsgBox "Your Invoice was successfully Saved"

View 2 Replies View Related

Modules & VBA :: How To Change Name Of File Output Report Is Being Saved As When In PDF

Jun 4, 2014

DoCmd.OutputTo acOutputReport, "Estimate", acFormatPDF, "c:TestMyReport.pdf"

the following code saves my report in a folder called test as a pdf file with the name MyReport. I have a string variable called RepName. How can I make the report get saved under that name.

I tried
DoCmd.OutputTo acOutputReport, "Estimate", acFormatPDF, "c:Test&MyReport&.pdf" but it dosent work.

View 1 Replies View Related

Forms :: Text Box Value Based On Two Other Textboxes

Oct 12, 2014

I have three textboxes , textbox 1,textbox 2, and textbox 3, I can change the value of textbox 3 based on the date of textbox 2 by using

if me. textbox2 < date then
me. textbox 3 ="expired"
end if

but I need it to look at textbox 1 as well and only change textbox 3 to "expired" if both conditions are true. example

if textbox 1 = "abs" and
textbox 2 < date
then textbox 3 = "expired".
end if

View 10 Replies View Related

Enabling Textboxes Based On Combo Box Selection

Nov 8, 2006

Hi all,

Is there any way of enabling/disabling a number of text boxes/checkboxes, based on a combo box selection, for example:

Combo Box 1: Airport Selection
Combo Box 2: Customer Selection

Once the user has selected the customer, based on the airport selection there will be about 10 text boxes and a few checkboxes that I'd like to allow or "ghost" depending on whether we are contracted to carry out work for that customer.

Any help would be appreciated.

thanks, Graeme

View 2 Replies View Related

Autofilling Textboxes With Table Data Based On A Combobox.

Nov 17, 2006

I am creating an Access program for logging in Parcels that are delivered and I am having some problems.

I have a Table called 'Contacts' and within this there are 4 Columns: 'Names', 'Departments', 'Extensions' and 'Emails'.

I also have a Form and there is 1 Combobox and 3 Textboxes relating to this Table: 'Addressed To', 'Department', 'Ext Number' & 'Email'. (see http://c0ld.homeip.net/parcel_log.jpg for details).

What I would like to do is select the Name from the Combobox (Addressed To) and the have the other Textboxes (Department, Ext Number & Email) get auto-filled with the corresponding data that’s within the Table for that Name.

If anyone would like the .mdb for this, please PM me.

Thanks for your help in advance.
Ross Hurrell

View 7 Replies View Related

Forms :: Lock / Unlock Textboxes Based On Option Button?

May 11, 2014

I have a form with 2 option buttons on it one with year 12 on it and one with year 13. I have a simple form with drop down menus and text boxes allocated for year 12s and 13s. I want all of the year 13 text boxes and drop down lists to be locked if year 12 is selected and I want all of the year 12 text boxes and drop down lists to be locked if year 13 is selected. I do not want to over complicate the form by hiding parts of it or having a new form open depending on the option button selected.

View 9 Replies View Related

Using DSUM With Textboxes - Display Total Of Hours Based On Date

Jan 19, 2015

I am having difficulty getting a second textbox to display the correct total of hours based on a date entered into a first textbox.

Setup:

Table Name: TestTable1
Fields: 'RequestDate' & 'Hours'
Form: 'Form1'
2 Textboxes Unbound: Named 'Date' & 'Total'

What I am trying to accomplish:

Based upon a date entered into the "Date" textbox I want the "Total" textbox to display the total hours associated with that date.

What I have tried:

I have tried using, in the control source property of the "Total" textbox, many iterations of both Sum(IIF & DSum(

I am currently using the following:

=DSum("[Hours]","TestTable1","[RequestDate]='Forms! Form1!'Me.Date'")

I have tried this without the Forms designation; without the "Me" designation; Etc.

Some attempts return the Error or Name error while other efforts return a blank textbox...

View 4 Replies View Related

Open A Word File From A Form

Jun 5, 2005

Hi all
I need to run a certain file from the form
I create a button as follows
Select in the categories "Applications" then select "Run Ms Word"
I have tested it and it open Word but not even a blank page
I then open the code as seen below and want to insert the filename but do not know where. Can someone please help me?

Private Sub Command35_Click()
On Error GoTo Err_Command35_Click

Dim oApp As Object

Set oApp = CreateObject("Word.Application")
oApp.Visible = True

Exit_Command35_Click:
Exit Sub

Err_Command35_Click:
MsgBox Err.Description
Resume Exit_Command35_Click

End Sub

The file is - D:PanelbeatersPb Manual.doc

View 2 Replies View Related

How Do I Use A Form Field To Open A File On My PC ?

Jun 2, 2005

I am trying to write a little database to view my MP3 collection (as you do when youre bored...)

I have a field that shows the full path to my MP3's

e.g "D:My MP3'siTunes MusicBob DylanDesire3 Mozambique.mp3"

I want to be able to click on the file link to launch the file in my MP3 player - I have tried changing the field type to "hyperlink", but that still doesn't work...

Any help greatly appreciated.

View 2 Replies View Related

Open PDF File From Access Form

Sep 8, 2012

I have a lot of pdf file that we save every day and name them like this 8012012,8022012, that are 2 digits day, 2 digits month and four digits of years no slashes. The fields are txt fields that we receive from banks. After processing their data, the upper management wants me to open those pdf files form access . I have created form named frmOpenPdf, placed text box named txtName and placed also command button named cmdOpen . I research code over internet and here is below, but it doesn't work;

Dim avCodeFile As CAcroAVDoc
Dim MYSRTING As String
MYSTRING = txtName.Value
Set Acroapp = CreateObject("AcroExch.App")
Acroapp.Show
Set avCodeFile = CreateObject("AcroExch.AVDoc") 'This is the code file
avCodeFile.Open "C:Documents and SettingsDesktopETFPdfFilesMYSTRING.pdf",

I would like to have like this : an user types 08012012 and the code execute to open file names 0802012 in command button .

View 1 Replies View Related

Open PDF File From Access Form

Feb 13, 2012

I have a form where I enter data about Cities (just an example). The user will be able to to pick a pdf file (for example history of the city) and add its location in the matching record. Then anyone reading the form will be able to open (from a simple command button) the proper file.

City File
London london.pdf
Athens athens.pdf

I need a browse button for user to select the proper file and a command button. And I think that the file should always be available in the same URL.

View 7 Replies View Related

Modules & VBA :: Display Image On A Report Based On Path Saved To Each Record

Jul 25, 2013

I have a piece of code that I'm using to display an image on a report based on a path saved to each record. the code is:

Code:
Option Compare Database
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If IsNull(Me.ImagePath) Then
Me.ImgPic.Picture = "O:BellinghamIntranetProductionLabelsNo Label.bmp"
Else
Me.ImgPic.Picture = Me.ImagePath
End If
End Sub

It seems like every few months the code crashes access and then never works again. When I debug, the part that is highlighted is:

Code:
Me.ImgPic.Picture = Me.ImagePath

The only way i've found to correct it is to delete the report and the module and copy them back in from a backup database. What could be causing this code to crash or how to stabalize my database to prevent this from happening again.

View 14 Replies View Related

Forms :: Button In Form To Open Different Form And Chose A Customer Based On Last Form

Mar 26, 2013

Basically I have a Customer Form, which I have a New party button on it,this button opens up the party form to a new party, what I would like it to do is open up a new party but make the new party for the customer I had selected in the previous form.I have tried the GoTo macro's but cannot seem to get it to work.

I am thinking on clicking the button it will need to get the Customer ID, and then open the party form, create new party, and paste in the Customer ID, which then updates the Name - Date - Address - Company Fields.

View 5 Replies View Related

Open Word File Off Access Form

Jul 9, 2012

I have fairly large Access 2003 tables and forms on my job. I am curious if I can open word document off the form by using command button. Very often I need to put info off the form to word and sent it via e-mail to clients so I every time I have to keep a lot open word documents at the same time on my computer 10 or more that is slow pc down. I would like to have like this : on specific form I have command button and when i need to work with word document , click that button that will open specific word doc and when I am done I think I need a second command button to safe and close word document and so that i can attach it to e-mail and sent it out. So every time I need to work with word doc, I can open it off the form and close it also when I am done with it so no word doc would be open unnecessarily.

View 8 Replies View Related

Forms :: Open Blank Form Based On Value In Text Field In Main Form

Jun 6, 2013

I have one table containing name of restaurant with its address etc. Then i created another table to list out the restaurant workers names and details. Just as an example,

Table:Restaurant
Restaurant name
Address line 1
Address line 2
Restaurant #
Website

Table:StaffContact
Staff Role
Name
speciality
email
phone

I have the main form that has all the restaurant details only. And i have another form containing the Staff information. Please note the two table have a relation and it works well.

Now to make it user friendly(basically easier for the lazy ones), I dragged the staff contact form on to my main form and displayed it as a datasheet(basically a sub form).

Now, my boss does not want users to add/delete on this sub form(datasheet). So,he wants me to create buttons to open new record of staff for each restaurant(new form)

My issue is with opening a new record to enter a new person to the staff list and give them a role as well in form view.The new form has

So i ran a Macro, with open form with Where condition

Code:
[Staffcontact]![Rest Name]=[Forms]![MainForm]![RestaurantName]

But, it does not work .

View 2 Replies View Related

Programming For File Open Dialog In Access Form

Oct 11, 2004

I want to retrieve some parameters from file, So for that i want to implement File Open Dialog
in One of the form. File Open Dialong is available in Micrososft Common Dialog controls.

When i choose Microsoft Common dialog control from extra toolbars, it gives me error saying that "You don't have licence for using Common Control ActiveX.

Any help appreciated.

View 1 Replies View Related

Open Second Form Based On Info In First.

Feb 2, 2005

I have a Form1 that is based on a select query with a criteria [Enter PIN number]. When we enter the PIN it returns the correct result. I want to have a button that opens a second form based on the same PIN number entered to open the first (in fact there will be numerous forms I want opened based on this PIN).

Example:

Sidewalk - button
Curb X button
Tree - button
Hydrant X button


In the example above, only CURB and HYDRANT returned an entry. Therefore when I click on the button next to CURB I'd like the frmCurb to open showing the data based on the PIN numbered entered to open the From1, and when I click on the button next to HYDRANT it would open frmHydrant showing the data for HYDRANT based on the same PIN number entered to open the Form1.


Thanks,
SKK

View 12 Replies View Related

Open Form Based On Value From A Listbox

May 19, 2006

Hello !

I am a newbie in access and would appreciate if someone could help me with a delicate problem i have

I have listbox in formA named "Liste1", this listbox contains a departmentvalue (unique) in the first column shown in the listbox.

What i want to do is open a new form (frmStructureDetails) by doubleclicking on the listbox, and i want the new form to load with filter on that department. Btw the departmentvalue is textformatted.

The result i get is a dialoguebox opening and not seeming to recognize which value to use, if i fill inn the value i clicked on the form loads with the correct data.


What am i doing wrong:

Private Sub Liste1_DblClick(Cancel As Integer)
On Error GoTo Err_SearchList_DblClick
Dim db As DAO.Database
Dim rst As DAO.Recordset

DoCmd.OpenForm "frm_StructureDetails", , , "[Department] = " & Me.Liste1


Exit_SearchList_DblClick:
Exit Sub

Err_SearchList_DblClick:
MsgBox Err.Description
Resume Exit_SearchList_DblClick

End Sub

View 1 Replies View Related

Forms :: Open A Form Based On Current Form?

Nov 23, 2014

When I have a form called "SiteForm" open and click a button "NewCalloutButton" I would like it to open up a form called "CalloutFormEntry"

I've done this using

Private Sub cmdOpenDetail_Click()
DoCmd.OpenForm "CalloutFormEntry", , , "CalloutID = " & Me!CalloutID
End Sub

However this brings up all the records linked to the calloutID

What I'm after is to open the CalloutFormEntry from the SiteForm in a dataentry kind of format but to carry over the current SiteID based on which site is open on the SiteForm. That way there's no user error logging callouts to incorrect sites.

View 9 Replies View Related

Open New Form Based On Listbox Selection

Oct 25, 2005

I have a form which has a listbox listing all the letters a student has had sent home. Basically i want to be able to click on a letter in the list box and for a popup form to open with the record details. However it just brings up a blank record.

The list box has a unique field called standardletterID.

the code behind the button to filter was just used through the wizard to open the popup form is:

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmstandardletterspopup"

stLinkCriteria = "[StandardLetterID]=" & Me![List0]
DoCmd.OpenForm stDocName, , , stLinkCriteria

but it doesnt seem to be working :(

I thought this would be easy but no matter how much i destroy my database trying to do it its not playing ball!

View 1 Replies View Related

Open Subform Based On Form With Combo Box

Oct 27, 2005

I have a main form (FRMProspects) with a combo box (ComboCoName) that has a query as it's record source to sort the records displayed in it. It is bound by the CustID (autonumber), but displays the CompanyName.

What I want to do is open a sub form FRMNotes, based on the Company name that is selected in the ComboCoName. So for Company XY, I want to click on the Notes command button to open up all the notes for that company only (filtered). FRMNotes is based on a different table, but TBLProspects and TBLNotes are linked by CustID (one to many).

What code do I need for this? I am treading water with VBA!

View 4 Replies View Related

Forms :: Open Another Form Based On ID If No Records

Apr 9, 2015

I'm working on a database for residents at a care home. I've just started and I want to automate a process where I can click a button and see the contact details of a GP. It's all working but I want it to be that if the resident has no GP it will open a form so you can choose a GP. I have a message box to tell the that the resident has no GP and it takes them to the relevant form but I need it to be based on the correct residents ID and it is not. I have the code running on form load. I have attached a zipped version of the database (it is safe I promise)

View 5 Replies View Related

Modules & VBA :: Open Form Based On Subform ID?

Mar 7, 2014

I have a form (frmSearch), based on (I think) John Big Bootys code. On it, a search box, which filters results as you type. Works great.

Instead of presenting the search results in a listbox, I wanted it in a subform (sfmSearchresults). Also works great.

Problem was this: I wanted a button on this form, to open another form based on [CustID]. For a listbox, I could use columns(0), but not for a subform. After much trying I got this to work:

Code:
Private Sub cmdVisaPren_Click()
Dim strWhere As String
strWhere = "[CustID] = " & Me.sfmSearchResults.Form.Controls.Item(5)
DoCmd.OpenForm "frmAddCust", acNormal, , strWhere, acFormEdit, acWindowNormal
End Sub

The part that I don't understand is the Item(5). The subform is based on a query (qrySearch), from tblCustomers. tblCustomers fields is as follows:

CustID, FirstName,LastName,Adress1,Newspaper1,Newspaper2.

Item(0) in strWhere would return Adress1 as [CustID].
Item (1) = Newspaper1, Item(2) = Newspaper2, Item(3) = FirstName, Item(4)=LastName, and (finally) Item(5)=CustID.

I don't get the logic. With listboxes, I could just count columns for columns().

Have attached my database. It's just a test database, with 4 people. The final database will have about 1200 people, and many more fields. Its .accdb (Access 2013). I tried converting to Access 2002-2003, but couldn't get it to work.

View 4 Replies View Related

Use Hyperlink To Open Form Based On Value In The Field?

Jun 12, 2014

I have a continuous form that lists all unapproved invoices. I would like to have a hyperlink at the end of each row that says Review and will open another form that queries the details of the unapproved invoice based on the invoice number in the current row.

View 9 Replies View Related

Open Relevant Form Based On 2 Combo Boxes?

Apr 6, 2006

Hey guys, I'm not sure if this is possible, and it is the most challenging thing that I have tried to implement into my database to date.

What I have is a booking form which allows you to Add Bookings for camera kits.

When a customer comes in and would like to book a kit, the form must be filled in with the relevant details, I have 2 combo boxes on this form.

The first is the Kit selection, there are 5 camera kits.
The second is an option to book the full kit out, or just components.

So here's the tricky part...

When the first combo box selection is made (eg. Kit 3) I need the Kit3 table to be active.

Then, when the user selects "Components" from the second combo box, I need a form to open up based on both of the above.

So a form based on tblKit3 would be opened and the user can manually select the components that they require to be booked out.

Any help at all would be appreciated.

View 1 Replies View Related







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