Call A Button Click On Another Form

Feb 6, 2006

Hello everyone!

I need to call the button_click procedure for a button on a form (button1), from another form, if you see what I mean!.

Basically the user opens form1. They click a button which opens form2. Once they have finished on form2 they press the close button, which is the point where I need to call the button1_click procedure on form1.

I imagine it's something like this:

Call Forms![frmForm1]![button1]![Click] or
Call Forms.[frmForm1].[button1_Click()]

But no matter what syntax I try it just won't work!
They're very basic forms, with only 2 buttons on and basic commands.

Any help appreciated!

Thanks

View Replies


ADVERTISEMENT

Code Triggered From Label On Click Behaves Differently From Command Button On Click

Nov 7, 2006

Often I use Labels as buttons due to the fact I can colour them the way I want, and use the on click event to trigger code.
The code below however works for a command button, but not a label button.

DoCmd.OpenForm "frmdatetime"
Do While Forms!frmdatetime!OKFlag.Caption = "False"
DoEvents
Loop

When this code is run by clicking on a command button, it works fine.
If run by clicking on a label, frmdatetime opens, but the mouse will not work on either of the 2 open forms unless you go down to the windows task bar, jump onto another window, and back onto frmdatetime.
If I remove the loop with the DoEvents in it, then the problem does not occur.

Can anyone enlighten me as to why this behaviour occurs.

Thanks

Richard

View 4 Replies View Related

Run Button Continuous Form With One Click

Aug 9, 2014

I have a continuous form with button for every record, wich has a VBA code. I want to put Button in header form, when i click it, then should run all button in continuous form. How can I do that.

View 14 Replies View Related

How To Make Click A Button On Form

Feb 21, 2014

After data is entered into text box, on the "On Enter" event, how do I make it click a button on the form?Similar to the effect of when you enter your username then password, most people just hit enter on the keyboard to auto click the login button.

View 1 Replies View Related

Display DB Document With Button Click On Form

Dec 19, 2006

I have documents (mostly Word) stored in an Access table. The table contains two fields. (1) a text field with the document's name and (2) an OLE field that holds the document.

When I press a button with the document's name on it (or it could be a hyperlink or a dropdown) on a form then I would like the document stored in the matching OLE field to open in the appropriate program for that document.

If I could set the permissions of the document to read-only then that would be great too. If I could prompt for read-only or read-write (no password necessary) access upon opening then that would be even better.

I can store documents in the table, but I have no idea how to launch them from a form button (or hyperlink, or dropdown).

Note: This is all within Access. This is not a web page related question.

Thanks in advance,
Andrew

View 3 Replies View Related

How Do I Make My Form Reset When I Click A Button On It?

Nov 11, 2004

How do i do it?

i can make a buton and edit stuff, im currantly learning VB .NET at the mo if that helps at all!!!!!

View 3 Replies View Related

Modules & VBA :: Can Only Click Button Once Per Form Load

Feb 3, 2014

I have created a button that works fine however it will only work one click per form load and i cant seem to figure out why.

Code:
Private Sub BntExpired_Click()
Dim QryAllCourses As recordset
Do Until ExpiryDate > Date Or ExpiryDate = ""
MsgBox ([FirstName].Value + " " + [SecondName].Value + "'s course in " + [CourseName].Value + " has expired")
recordset.MoveNext
Loop
Exit_BntExpired_Click:
Exit Sub
Err_BntExpired_Click:
MsgBox Err.Description
Resume Exit_BntExpired_Click
End Sub

View 8 Replies View Related

Forms :: Button Click Event On Continuous Form

Nov 25, 2013

I have a continuous form with a button 'Cmd1' & a textbox 'txtMail' which is set to visible no.

When the user clicks Cmd1 - then txtMail becomes visible.

I can do it using vba on the buttons click event but when it executes txtMail for all the records become visible.

How do I use a button's click event on the form's current record - Private Sub Form_Current() so that when the user clicks Cmd1 on the current record only txtMail for that record becomes visible.

I'm using Access 2007.

View 10 Replies View Related

Forms :: Refresh Form Data On Button Click

Feb 24, 2015

Here is the scenario:

Form 1 - Data entry for a new project
Form 2 - Data entry for a task associated with the project in the Form 1

Button on form 1 that opens Form 2.

What I am trying to do:

Use a combobox on Form Two to choose the Project entered into Form 1, so I can capture the Form1 PK as a FK on Form 2.

Here is the problem:

Refreshing the record on the button click so that the new option entered into Form 1 shows up in the combo box on Form 2.

Full disclosure:
I'm not much good at VBA so I have been trying to do this by customizing the button macro. I have tried Refresh, and Requery, but I can't seem to get it to update the list in the combo box.

2 questions:

1. How can I get this accomplished?
2. Is there a better way to get this data into the table than what I am trying to do?

View 3 Replies View Related

General :: How To Open Another Database On Button Click At Form

Dec 11, 2012

i want to ask is there any way to open another access database using when click button at form.. for example i have tracking.accb then at my switchboard form, i would like to have a button that can go to another access which is borrow.accb. can these possible for me to do it..?

View 3 Replies View Related

Open Another Access Database When Click Button On Form

Dec 11, 2012

I want to ask is there any way to open another access database using when click button at form.. For example i have tracking.accb then at my switchboard form, i would like to have a button that can go to another access which is borrow.accb. Can these possible for me to do it..?

View 4 Replies View Related

Modules & VBA :: Click Button On Form In Database And Login To Website?

Jul 11, 2014

I'm new to Access and I'm using Access 2010.

I would like to be able to click a button on a form in my data base and login to a website using my username and password.

The manual login, requires two clicks after username and password, "Login" and "Click to continue"

I have tried many solutions found on the internet, none work for me. One forum reply was to send me a link to another site and it was for Excel. Is the code the same? Didn't work anyway.

From the website I want to login to, I have copied the code into a Word doc from the "inspect element" to work out the names of the fields I'm trying to put my username and password into. (see attached)

I would also like to be able to use Google Chrome as my web browser if possible?

View 8 Replies View Related

Forms :: Continuous Form - Populating Date With Button Click

Oct 14, 2013

So I have a continuous form and I have a button that is pressed when a job is released and it record a date in a field. I wanted to turn that button to disabled after pressed but after lots of reading found that it couldn't be done in a continuous form due to it disabling all buttons . So I decided to just make the code populate the field only if it was a null value so that it wouldn't overwrite a value if someone pressed it more than once. Well the null is my downfall in all this. I cannot make it compare and populate the date when the button is pressed. I have tried all I can find on the net and all I can think of.

View 11 Replies View Related

Forms :: Open Search Form With Mouse Click On Button

Jul 17, 2013

How to open a search form with a mouse click on Button_Search

My idea is to pop up a form where user can enter the search text and select the required name and get back to the old form with all details about the entry. This form alone is workign fine. I want to call it in a mouse click. and pass the data back to old form.

View 7 Replies View Related

Forms :: How To Update Form Fields To Table Through Click Button

May 19, 2013

I have 6 text box on the form which are unbound. Now we enter the entry in these boxes then I have update button on the form to update the record in table. all fields should be clear after update the records in table so I can enter the new entry.

I am using ms access 2007. Is there any liberary to add?

Form fields

text1
text2
text3
text4
text5
text6

Table fields

emp_id
batchid
training_name
training_hour
start_date
end_date

View 13 Replies View Related

Modules & VBA :: Form Bound To A Table - Button Click And Then Date / TimeStamp

Jun 30, 2014

I have created a form that is bound to a table.

There is a button on the form that allows users to send email with the form as an attachment in pdf. I'd like to create a date/time stamp in another table called tblLog. Trouble is the code works uptil sending emails but it doesn't record the stamp.

Heres what I've done so far.

Private Sub cmdEmail_Amd_Click()
On Error GoTo cmdEmail_Amd_Click_Err
DoCmd.OpenForm "frmAmendment_Master", , , "[Record_ID]=" & Me.Record_ID.Value
DoCmd.SendObject acForm, "frmAmendment_Master", "PDFFormat(*.pdf)", "", "", "", "Amendment Form" & " " & Surname & " " & Firstname, "", True, ""

[Code] .....

View 3 Replies View Related

Forms :: Enter Tracking Number - Click Button To Search Record On Form

May 24, 2013

I currently have a database where new records can be entered in a "New Part" Form and Records can be viewed(but not altered) in a "Part Search" Form. The forms are the same except one is allowed to edit. I have also created another form where I am trying to search the "Part Search" Form via a tracking number. I want to have a text box where users enter a tracking number then click the button to take them to the record on the "Part Search" Form.

View 2 Replies View Related

Modules & VBA :: Static Shell Function Call Works But Dynamic Call Fails

Sep 4, 2013

I'm having to recode some old MS Access DBs so they will run in the following environments:

Office 2000 on WinXP
Office 2003 on WinXP
Office 2010 on WinXP
Office 2000 on Win7
Office 2003 on Win7
Office 2010 on Win7

When I wrote my code for Office 2000 on WinXP things were simple because directory paths were the same across all computers and I could hard code pathing when using a shell command to launch other files.

My new approach is to make a function call to the Windows registry to determine the default executable and path for opening a file based upon its extension (see apicFindExecutable in basWindows API module).

I'm able to use code to create a shell call and debug print it to the immediate window. If I put my cursor in the immediate window at the end of the shell call and hit [enter] the external file will open as desired. If I try to open the external file directly through code, I get a file not found error.

To recreate the error take the following steps:

(1) browse to files that are accessible from your computer
(2) click the PREPARE DATA AND OPEN MAIL MERGE DOCUMENTS command button

Shell function call is made by the fnOpenFile function located in the basOpenFile module. There has to be a trick here that I'm missing.

View 5 Replies View Related

Click Of A Button

Sep 20, 2006

Ok if I sound like I do not know what I am talking about, that would be correct. That is why I am asking here.

So I have this form called frm_UserMaintenance

On The form I have a button

I would like to have an OnClick event that will activate one of the dialogue boxes on the tools menu.

Heres the catch. The menu is not visible and i do not want to make it visible. This makes using sendkeys a non option.

Any ideas????

View 5 Replies View Related

Force A Button Click

Feb 9, 2005

I have a form on which I have a button that I want the user to click after a cetrain field on that form is updated.
I display a little pop-up box saying to make sure that a user clicks on that button.
Is there a way to know that this button was clicked? Is there a way to not proceed with anything else until that button is actually clicked?

Thanks.

View 4 Replies View Related

Only Allow Updates After Button Click

Sep 19, 2005

Hi,

I have a form with a number of drop-down lists on it and each of these lists is bound to a field in a table.

When I return the results of a search to this form I want to allow users to be able to cycle through the records and change them if they want. However, the changes should only be saved if the user clicks on the "update record button". This button is simply the save record button by the MS Access wizard.

At the moment if they change the value in one of the drop down lists and move onto the next record the change is saved even though the user doesn't click any button. I want to prevent this from happening.

Any ideas on how I might achieve this?

If I prevent "AllowEdits" in the form properties I can't update the form using the "update record button" either.

Many Thanks,

View 2 Replies View Related

Ping At The Click Of A Button

Nov 10, 2005

Afternoon people,

Just a query (no pun intended). Is there a way to ping an ip address which is taken from a table and at the click of a button it pings? Bringing up the cmd app to show the results.

Cheers,
Storm1976

View 1 Replies View Related

Button Single Click

Nov 22, 2005

I currently have a form with a button that once clicked displays a word document,however I have to double click on the button even though the code is on the single click event property.The only line of code is as follows
OLEFile.Action = acOLEActivate

Does any body know how I can get the single click to work ?

View 2 Replies View Related

How To Print On Button Click ?

Sep 6, 2006

Hi all....

I have a list box that I can select mulitple items from - I then click a search button and it runs a query that finds what I am looking for from a table and then displays the results in a subform.
In the subform I can input weights and get a percent....anyhow.

How do I set up a button so that it will print out a report or the report from the subform information that is currently being viewed.

Also, I can already do this by clicking a button on the form and pulling up the installed report program but, you need to input data to get this report.

I kinda want this button to be a "I need it now" type of print option.

Thanks...as always my questions are probably confusing...:D

View 2 Replies View Related

Add Record Only On Button Click

Sep 7, 2006

I was wondering if there is any way to control a user's input in to a form such that data entry does not automatically create a new record. Is there any way to collect all inputs in the text/combo boxes and create the new record only when a button is clicked? Cheers, David.

View 1 Replies View Related

Help!Command Button Captions On Click

Aug 9, 2005

Hi all!

I have this command button whose caption switches from update record to save record with a msgbox verifying if the person really wants to take this action. On click the user is then allowed to update the record then in theory they would be able to hit the same button whose caption now reads save record, the msg box would appear with a yes or no answer required. The code I have is putting the msg box after the user clicks the update button.

Anyhelp and/or suggestions would be most appreciated!


Private Sub cmdOpen3_Click()

stDocName = "frmSearch"

If cmdOpen3.Caption = "&Update Record" Then
If IsNull(Me.FTMSubform.SourceObject) = False Then
Me.FTMSubform.SourceObject = "frmFTMInfo"

Me.FTMSubform.Form!txtFirstName.Enabled = True
Me.FTMSubform.Form!txtFirstName.Locked = False
Me.FTMSubform.Form!txtFirstName.BackStyle = 1
Me.cmdOpen3.Enabled = True
Me.cmdOpen3.Caption = "&Save Record"
Me.cmdOpen4.Enabled = False
Me.cmdOpen4.Caption = "&Update Record"
Else
Me.FTMSubform.Form!txtFirstName.Enabled = False
Me.FTMSubform.Form!txtFirstName.Locked = True
Me.FTMSubform.Form!txtFirstName.BackStyle = 0
Me.cmdOpen3.Enabled = False
Me.cmdOpen3.Caption = "&Save Record"
Me.cmdOpen4.Enabled = True
Me.cmdOpen4.Caption = "&Update Record"
End If
End If

If cmdOpen3.Caption = "&Save Record" Then
If IsNull(Me.FTMSubform.SourceObject) = False Then
Me.FTMSubform.SourceObject = "frmFTMInfo"
If MsgBox("Save update to this individual?", vbQuestion + vbYesNo, "Save Update?") = vbYes Then
DoCmd.Save
DoCmd.Close acForm, "frmFTM"
DoCmd.OpenForm stDocName
Else
MsgBox "Return to the FTMInfo Form!", vbInformation, "Save Function Aborted!"
End If
End If
End If
End Sub


~Van

View 2 Replies View Related







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