Browse Button In A MS Access Form?

Below is a pic of the form I'm having trouble with. the poject is a database of golf courses. there is a form for entering/viewing information for each hole for each course. basically each record has a thumbnail pic of the hole.

That browse button needs to do something. It needs to open a browse dialog box, similar to the browse dialog box you get on many other programs. The idea is that the user selects the picture from the browse dialog box and the file name of this picture is put in the PhotoFile field.

I have no idea where to start on this, but I did check out the Northwind database that comes with Access - its similar but has loads of other functions bundled with it that I don't need and doesn't work without these functions.

I'm no programming genius either! so any help is greatly appreciated.
Thanks

View Replies


ADVERTISEMENT

Form Browse Button Code

I am designing a form and I need to add a Browse button to it. I need the Browse Button to point to the "My Computer". Once that file is selected I need it to fill in the hyperlink box. I have the hyperlink text box on the form and it works if you manually type a link in. I would like it to auto fill-in with the selected file.

Any help would be great!!

Thank you :)

View Replies View Related

Browse Button

Hello all:
I'm trying to create a browse button in MS Access. Here is the code I've used so far:

Private Sub ImgBrowse_Click()


Dim OFN As OPENFILENAME
On Error GoTo Err_cmdInsertPic_Click

' Set options for dialog box.
With OFN
.lpstrTitle = "Images"
If Not IsNull([ImageFullPath]) Then .lpstrFile = [ImageFullPath]
.flags = &H1804 ' OFN_FileMustExist + OFN_PathMustExist + OFN_HideReadOnly
.lpstrFilter = MakeFilterString("Image files (*.bmp;*.gif;*.jpg;*.wmf)", "*.bmp;*.gif;*.jpg;*.wmf", _
"All files (*.*)", "*.*")
End With

If OpenDialog(OFN) Then
[ImageFullPath] = OFN.lpstrFile
[ImagePicture].Picture = [ImageFullPath]
SysCmd acSysCmdSetStatus, "Afbeelding: '" & [ImageFullPath] & "'."
End If
Form.Refresh
Exit Sub
Err_cmdInsertPic_Click:
MsgBox Err.Description, vbExclamation
End Sub

and here is what is in my module:

Option Compare Database

Public Type OPENFILENAME
lpstrTitle As String
lpstrFile As String
flags As Long
lpstrFilter As String

End Type

When I attempt to compile it says Sub or function not defined and highlights MakeFilterString. Why is this and how can I fix it? An ideas? Thank you

View Replies View Related

Browse Button

Hello

Is there any way to save the file path to a field on a table, usign a browse
button?

I tried using a button type=file but i can't associate it with my table field.

Thanks

View Replies View Related

Browse Button

How to I place a browse button on my Microsoft Access form to be able to browse to a file and then place that link into a database field on the form?

View Replies View Related

Create A 'BROWSE' Button

Hello All,

Could someone give me a few pointers on how to create a 'Browse' button on a form with the intent to search for an image in an bound-image to record and assign it and store the bmp selected by the user from the user's machine?

I thank you in advance.

View Replies View Related

Browse Button To Image

i would like to create an browse button on my form so i can find the pictures i would like and then to been shown on the picture field on my form. i tried the northwood code from help but i could manage nothing woth it. do you have any idea to help ,me please??

View Replies View Related

Adding A Browse Button

I'd like to add a browse button on a form, so that the final user can choose what files are to be used for the application. Can anybody help me?

View Replies View Related

How To Browse And Load Mdb File From Access 2000 Form?

Hi guys. I want to design an access 2000 application that does the following.Inside a form
I want to be able brosse my hard disk and select an access mdb file . once i selected the db and click on ok,i want to be able to work on that mdb as if i opend it diretly. I be happy if some one teach me how to
create such browse mdb functionality. you can see the picture below.Thanks

http://i5.photobucket.com/albums/y180/method007/broserfordb.jpg (pic of browse mdb option)

View Replies View Related

Create A Browse Button That Put Results In Field

Is there a way to create a browse button on a Microsoft Access 2003 form that also will put the results in another text field.

Once the file is found and selected I need a text field updated with the file location.

View Replies View Related

Creating A Browse Button For Finding File Links - Version: 2002 (10.0) XP

I have a data access page that is used for entering a new record into my database. I would like to add a hyperlink field that gets its data from this page.

My problem is I need to add a way to easily add local file links (\useretcfile.htm for example) to a text box that will have a control source that is the hyperlink field. How do I create a "Browse" button to do this?

I can create a browse button using "File Field" in MS Script Editor but I don't know how to tie the result to a control source.

View Replies View Related

Browse For And Display Images In Continuous Form -- Access 2007 - Version: 2007 (12.0)

This example shows how to browse for a file and display the corresponding image in a continuous form.

The Image control in Access 2007 allows you to assign a ControlSource of a control containing a FilePathName for display, even in a continuous form.

The table t_Images stores ImageID (autonumber), FilePathName (text 255), DateCreated (date/time), and DateModified (date/time). In order to be truly useful, you will need to add and collect more (descriptive) fields for this table.

The form, f_Images has RecordSource = t_Images, and is a continuous form. It uses code written by Ken Getz to Browse for a filename, stores the file path and name, and displays the corresponding image. It is set up to collect JPG files but that can be changed (of course <smile>)

The SizeMode of the Image is --> Zoom
this means the image will be as large as it can and still fit within the control dimensions without distortion

The form also has a couple calculated controls to parse the path and file name and display both

The example data, of course, will not be on your computer, but you can replace the images in the records that are populated and add more. Although Access 2007 touts no database bloat from images, it needs to have BMP files (which are huge compared to JPG files). The Image control can render more formats than the Bound Object Frame control.

The form header displays the last path you picked files from and becomes the default path for future picks if a record is empty -- if not, the path of the current record is used. When the form is first opened, the default path is the path of the database.

If you wish to set the path to an existing record, simply click "Browse" for that record. If you do not actually change anything, the DateModified property is not changed.

The DateCreated property is populated using a DefaultValue --> =Now() in the table design

The DateModified property is updated in the form BeforeUpdate event if the record is not a new record and the FilePathName field has changed.

View Replies View Related

"Browse" Button:how To Create One?!

I'm creating a DB in a public institution and one of the objectives of this DB is to allow a common user to insert images in the same DB. My doubts are:

-Can I do this in a access form, creating a "browse" button?
and
-How do I associate this application to the field, where the images are going to be stored.

my Thanks...

View Replies View Related

"browse" Button: How To Create One Pt.2

hey...
I posted in this forum once to ask how to create a "browse" button...
a code was given to me (my thanks to meloncolly) but i search others options and i got this code:

Dim strFilter As String
Dim strInputFileName as string

strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.XLS)", "*.XLS")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)


'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, 1996

Type 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 String
End Type

Declare Function aht_apiGetOpenFileName Lib "comdlg32.dll" _
Alias "GetOpenFileNameA" (OFN As tagOPENFILENAME) As Boolean

Declare Function aht_apiGetSaveFileName Lib "comdlg32.dll" _
Alias "GetSaveFileNameA" (OFN As tagOPENFILENAME) As Boolean
Declare Function CommDlgExtendedError Lib "comdlg32.dll" () As Long

Global Const ahtOFN_READONLY = &H1
Global Const ahtOFN_OVERWRITEPROMPT = &H2
Global Const ahtOFN_HIDEREADONLY = &H4
Global Const ahtOFN_NOCHANGEDIR = &H8
Global Const ahtOFN_SHOWHELP = &H10
' You won't use these.
'Global Const ahtOFN_ENABLEHOOK = &H20
'Global Const ahtOFN_ENABLETEMPLATE = &H40
'Global Const ahtOFN_ENABLETEMPLATEHANDLE = &H80
Global Const ahtOFN_NOVALIDATE = &H100
Global Const ahtOFN_ALLOWMULTISELECT = &H200
Global Const ahtOFN_EXTENSIONDIFFERENT = &H400
Global Const ahtOFN_PATHMUSTEXIST = &H800
Global Const ahtOFN_FILEMUSTEXIST = &H1000
Global Const ahtOFN_CREATEPROMPT = &H2000
Global Const ahtOFN_SHAREAWARE = &H4000
Global Const ahtOFN_NOREADONLYRETURN = &H8000
Global Const ahtOFN_NOTESTFILECREATE = &H10000
Global Const ahtOFN_NONETWORKBUTTON = &H20000
Global Const ahtOFN_NOLONGNAMES = &H40000
' New for Windows 95
Global Const ahtOFN_EXPLORER = &H80000
Global Const ahtOFN_NODEREFERENCELINKS = &H100000
Global Const ahtOFN_LONGNAMES = &H200000

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

Function GetOpenFile(Optional varDirectory As Variant, _
Optional varTitleForDialog As Variant) As Variant
' Here's an example that gets an Access database name.
Dim strFilter As String
Dim lngFlags As Long
Dim 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 = varFileName
End Function

Function 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 filename
Dim OFN As tagOPENFILENAME
Dim strFileName As String
Dim strFileTitle As String
Dim 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 If
End Function

Function 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 & vbNullChar
End Function

Private Function TrimNull(ByVal strItem As String) As String
Dim intPos As Integer
intPos = InStr(strItem, vbNullChar)
If intPos > 0 Then
TrimNull = Left(strItem, intPos - 1)
Else
TrimNull = strItem
End If
End Function

well what to say... it works...
the problem is: the browse window appears and i can select the picture that i what, etc... BUT i don't know how to my selection be inserted in a field already created (object OLE) in a table.
so can you help me on this by changing this code or another option...
my e-mail: arch.007@gmail.com
my Thanks

View Replies View Related

Search Form, Continue To Browse

I adapted the findform from the address book sample database. After the search is performed I would like it to be able to continue to browse (continue scrolling through) the rest of contacts rather than excluding everything but matches. More like a go to kind of search rather than a select query. I'm betting this is a simple fix (I hope), I just don't know what it would be. Any help?

View Replies View Related

Need A Form To Browse Folder Location

I would like to create a form to allow the user to choose a location to place a file. I would prefer to have a browse command button so when he/she clicks the windows explorer view opens and the user can select the location. I have seen this done, but I am not sure where to start. If anyone has an example to show me, it would be greatly appreciated.

Thanks!!

View Replies View Related

MS Access Browse Function

I'm currently importing a sheet from Excel into Access 2003 using Docmd.TransferSpreadsheet.

This works fine but requires the path of the file in question to be stated as one of the parameters. I have donjhe this and it works but, I would like the user to be able to navigate to the file using the standard
open file dialog box.

Any help appreciated...AJP

View Replies View Related

Access Closes Unexpectedly When A Button On A Form Opens A Form - Version: 2002 (10.0) XP

I have created an Access 2000 database that is used on XP, locally. When the user clicks a button, it's supposed to close the main form and open another form. But the whole database closes unexpectedly. Other users who use this locally on their XP machines can open the form okay. Does anyone know why this would happen?

Edited by: mattysteve on Tue Mar 1 8:53:14 EST 2005.

View Replies View Related

Open A File From Access Thru Browse Window - Version: 2003 (11.0)

I am using the APIs mentioned on several threads here to allow a user to browse out for a file. They can find it and select it but rather than storing it locally, I would like this file to open in Word. This is for a project that uses many legal forms and at various points a word template needs to be opened up and filled in. So a button to open up the browse window with a filter for Word docs and intial directory has been created. I have a module with the APIs added and this is the code behind the button click event for one of the forms.... Now I need the user to be able to open this as in a common browse window.

Private Sub cmdOpenFeeInterest_Click()
Dim strFilter As String
Dim strFileName As String

strFilter = ahtAddFilterItem(strFilter, "Word Files (*.doc)", "*.DOC")
strFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select document...", _
Flags:=ahtOFN_HIDEREADONLY, InitialDir:="S:POOLLANDDFRM1 AGREEMENTS AND LEGAL DOCUMENTSDEEDS")
End Sub

View Replies View Related

Run Module From Access Form Button - Version: 2000 (9.0)

hi

set up a module and seems to be working when i run the command in the immediate screen!!

ive been looking for code to join the module to a button on the MS access form but cant seem to find any help. Do i need a macro? How?

any ideas? (Im sure you do!!!)

thanks again

View Replies View Related

Clicking A Command Button In An Access Form Using A Macro? - Version: 2003 (11.0)

Hi folks,
I am working on an automation project for which I need to click the 'command button' on a form from a macro. I tried using the SetValue option in the macro(after opening the form first) but havent been able to get it to work. Could someone tell me how to achieve this functionality....Your help highly appreciated!
Kurt

View Replies View Related

How Do I Create A Record Lock Button/toggle In Access Form - Version: 2003 (11.0)

Hi

I have a dataabse that many users connect to and work on. It's a simple survey app. However, I would like to create a toggle switch that when clicked locks that particular record, so that it cannot be edited by the other users.

I have tried to create something by usin the Form_beforeupdate event, and having a toggle switch called lockbool.

Only thing is once i lock the records, all records are locked, and i can't untoggle the switch because it's locked.

Any ideas or Links

Thanks

View Replies View Related

Disable Access To A Form Button Based On User Level - Version: 2003 (11.0)

I have a form (frm_mainmenu) that contains a button (btnOpenMaintain) that opens another form (frm_maintain). I want to place restrictions on access to frm_maintain.

There is a log in form (frm_logon) that has a combo box (cboLogin) which has a list of users defined from table dbo_users displaying the field strUsrLogin.

On this table dbo_users there is a field lngUsrType, which stores a number. I intend to use this number to define wether they can operate btnOpenMaintain. If the user is a level 9 then they can not access. If they have any other level, between 1 & 8, they can.

So I figured I could write a code like this, which will basically kick in wether that button is useable or not.

Code: Private Sub frm_mainmenu_Initialize()

Dim xuser As String
xuser = [Forms]![frm_Logon]![cboLogin]

If DLookup("strUsrLogin", "dbo_users", "lngUsrType=" & xuser) < 9 Then

btnOpenMaintain.Enabled = True
Else
btnOpenMaintain.Enabled = False
End Sub

My intention was that when the form frm_mainmenu opened it would trigger this blocking. However I can't get it to work. Does anyone have any suggestions how I can?

By the way my VB coding isn't to hot, so if you can suggest improvements be my guest.

View Replies View Related

Event Procedure For A Command Button On An Access Form - Version: Any Version

Hello
I have an access form to input the data and so my table will get updated automatically. I have a command button pasted at the bottom of my Form Design. When I click the command button I want the form to be printed. How do I write a event procedure to activate the command button to print on one click. My form name is SMAC.

Thank you very much for your help

View Replies View Related

Button To Run A Report From An Access 2003 Form - Version: 2003 (11.0)

Hi All.

I have a form that has various fields, one of which is a CustomerNo field. This form is used to enter data for the customer. I would like to add a button that when clicked by the user will run a report (CustomerActivity Report) which normally accepts the CustomerNo as the parameter from the user, but instead of the user having to enter the CustomerNo, it automatically enters it.

So if the user is in the CustomerNo: 123 in the form, when he/she clicks the button it automatically runs the report using CustomerNo: 123 as the parameter. By the way, the report's source is a SQL-Pass Through Query.

How can I do this?

Thank you in advance.

View Replies View Related

Looking For A Browse Control

i'm trying to put a button on my form to browse throw the files and when select a file loads the path and name of the file into a variable on my form, but i cant find the button "Browse".
anybody knows were the hell is that thing...
THKS.

View Replies View Related

Directory Browse

I have a form where I want to browse for the directory path and display in a text box.I have done something similar to browse for file and display, but this time round I need only the directory path to be displayed .Need help on this.

View Replies View Related

Code For Form Button To Open Second Form And Enter Data - Version: 2003 (11.0)

Hi,

I have a form called "INSECTS" to enter insect data. My fields are (there are lots more but for these purposes) SPECIES, SITE, COUNT, STAGE, HABITAT, NOTES in addition to RECORD_ID (the primary key) which is an autonumber field. The fields are all in the one table. The data is entered onto a blank form. I have a button on the form that writes the data to the table when clicked - button code below.

I need to seperate SPECIES, SITE, COUNT from STAGE, HABITAT, NOTES into two seperate tables (both tables would also have RECORD_ID and be linked). On the INSECTS form I want show only SPECIES, SITE, COUNT fields but provide the option to enter data for STAGE, HABITAT, NOTES - probably by adding another button on the INSECTS form that, when clicked, pops up a second blank form containing STAGE, HABITAT, NOTES

My question: How would I code this second button? (or is there a better alternative)

Cheers, Damian
-----------------
Private Sub cmdAdd_Click()

Dim NewID As Long

With CurrentDb.OpenRecordset("SELECT * FROM InsectTable WHERE 1=2", 2, 8)
.AddNew
NewID = !Record_Id
!Species= Me.Species
!Site = Me.Site
!Count = Me.Count
!Stage = Me.Stage
!Habitat = Me.Habitat
!Notes = Me.Notes

.Update
.Close
End With

MsgBox "New record is added", vbInformation

End Sub

View Replies View Related

Close Existing Form And Open Form With The Same Command Button? - Version: 2003 (11.0)

I have a command button that opens a new form. I want to make this command button close the current form in addition. I'm guessing that there is some code that can be added to execute this command? Does anyone know what needs to be done in order to do this? Thanks.

View Replies View Related

Open Calendar One One Form From Command Button On Another Form - Version: 2003 (11.0)

I have a date field on a Subform (ECNDetail) Mainform (ECNBCNVIPtbl). When the date field is clicked I want
to open another form that has instructions (EcnPopup1)(no problem with that). I have a Command Button
(CloseForm) that I would like to serve two purposes if possible. I would like for it to close the form and open
up a Calendar (CalMain1) on my Subform (ECNDetail). Is this possible and if so How. Below is the code that
I currently have. I appreciate all help with this. What our purpose is, before a date is put in the [Pending Date]
Field I want the (EcnPopupp1) to come up with work instructions. Then when the Ok or Close Form is clicked I
want the Calendar to popup so a date can be selected. I am open to try another way if someone has other
suggestions. Thanks for all help.

Please see code below. I have rem'd out the Close form part of the code. I know I somehow much call out
the form where the Calendar is located but I have not been able to accomplish this.

Code:Private Sub CloseForm_Click()
CalMain1.Visible = True
CalMain1.SetFocus
If Not IsNull([Pending Date]) Then
CalMain1.Value = [Pending Date].Value
Else
CalMain1.Value = Date

End If
'On Error GoTo Err_CloseForm_Click

' DoCmd.Close

'Exit_CloseForm_Click:
' Exit Sub

'Err_CloseForm_Click:
' MsgBox err.Description
' Resume Exit_CloseForm_Click

End Sub

View Replies View Related

File Browse Dialog Box....

I have a field in a form to which I wish to be able to browse to a particular PDF file. This location is then to be a hyperlink that when clicked upon, it will open the chosen file.

I have seen a thread already for file browsing, but it said to look at the VBA code, which I have no idea what it means :(

Please help, this is driving me mad.

TIA

RD

View Replies View Related

Help With Posted Browse Code

Hi, all! I really need some help from you geniuses here. I've never worked with modules and my coding from objects is very limited.

I need to create a browse button that will be used to select a file to import into my database, using a command button. I hope this makes sense. I was reading the post:

http://forums.aspfree.com/microsoft-access-help-18/how-to-link-fe-to-be-using-vba-76392.html?&highlight=browse+button

I am so limited in my aptitude for coding that I was totally lost reading this. I think that it is for relinking a database, with a browse functionality. Can anyone help me figure out how to adjust this to work for my needs?

Thanks!

KellyJo

View Replies View Related

Modify Browse Window

hi all

i'm hoping some guru can help me out here, i've got a function that opens up a browse window and lets me choose what sort of file type i want to view in a directory. what i need is to modify it so i can have the option of arranging the files by the date modified, so i can have the last file saved come up as the first file available.

anyone know if this is possible???

Code:Function 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 Function

View Replies View Related







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