Seems simple, but I haven't been able to crack this one.
I've searched and haven't found an obvious answer.
I want to hide a command button after it loses focus. I've tried placing this code on the On Lost Focus and On Exit events of the command button.
Me.cmdName.Visible = False
I get the 2165 error, 'Can't hide a control that has a focus'.
I guess one solution would be to force the focus to another control first, however, "how do I know what control the user is attempting to move the focus to?"
I have a form with three text boxes and one command button
I want to hide the command button from view until at least one of the boxes has data in it. I also want the command button to return to hidden if the data is removed
So far I have tried this on the after update event on one zof the text boxeswith absolutely no success.
Code: If Me.txtFirstName = "" And Me.txtLastName = "" And Me.txtSocialInsuranceNumber = "" Then Me.cmdAddNewClient.Visible = False Else Me.cmdAddNewClient.Visible = True End If
I am rewriting an old Access 2003 database in Access 2010. When creating new command buttons, the current theme gives them a default appearance. I need to apply this appearance to old command buttons. I know there is a way to select the default button and apply its properties to others quickly. I have done it before but didn't write the process down .
How can I hide all the command bars except my customize tool bar ? I have hide all my command bars by the following code :
' Hide all window bar
Dim i As Integer For i = 1 To CommandBars.Count CommandBars(i).Enabled = False Next i DoCmd.RunCommand acCmdWindowHide
I can change “CommandBars(i).Enabled = False” to “CommandBars(i).Enabled = True” but I want only my customized tool to be appear. What is the solution?
I have created a web-database (? - There are globes over all the forms and tables icons) based on the Issues & Tasks template. This means that most of the data is entered and seen on the "Main" form, which has two tabs - Open Issues and Closed Issues. I have created a form that allows people at my work to input the necessary data and save it, so that it will show up on one of the two tabs. However, once a record has been created, I want to be initially locked if the ID/PK is clicked, so that data can't be changed or entered inadvertently.
SO, I changed the code so that when the ID/PK for a record is clicked, it brings up a different form, but one that looks exactly like the one that is brought up when entering a new form, but I locked all of the fields so that the information cannot be changed. It seems from what I have read that I can create a button on this form so that when clicked, it unlocks the fields on the form so that they can be changed, and then when clicked again it will lock the fields again. Is this true? If so, how can I do it? Or is there something similar I can do? I have seen codes that I could copy and paste, but I cannot figure out the place to copy and paste codes in Access 2010.
I have changed the Form properties so that Data Entry and all the "Allows" are set to No...
Hi, I have got a small problem and maybe someone could advise me. I am creating a customised command button from a label button. The new button works fine but I can't apply the 'requery' function to it, if i do an error occures and i am being prompt to save the data first???? :confused: :
Private Sub Labelsearch_Click() Me!itemquery.Requery End Sub
Private Sub Labelsearch_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Me.Labelsearch.SpecialEffect = 2 Me.Labelsearch.BackColor = 255 Me.Labelsearch.ForeColor = 10092543 Me.Labelsearch.FontItalic = True Me.Labelsearch.FontBold = True End Sub
Private Sub Labelsearch_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Me.Labelsearch.ForeColor = 255 Me.Labelsearch.FontItalic = False Me.Labelsearch.FontBold = True End Sub
Private Sub Labelsearch_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) 'Come back to initial state when button release' Me.Labelsearch.SpecialEffect = 1 Me.Labelsearch.BackColor = 16373685 Me.Labelsearch.ForeColor = 8388608 Me.Labelsearch.FontItalic = False Me.Labelsearch.FontBold = True End
If I create a command button with the wizard and assign the code : me!itemquery.Requeryto the on_click event my form is working fine. Why is his code is not working if I assign it to a label? :o
Hi, I have a main form which has a subform with another subform in it. Subform 1 gives details of a loan and a balance field which is calculated in subform 2 after amt paid is entered - using a macro on exit.
If the balance is zero after amt paid is entered. I want the amt paid field in subform 2 to be locked or disabled - preventing the user from entering further payments by mistake.
I want to show or hide a box on a continuous form. If there is a date in the ShopOut field i want the label to show up , if not then it will not appear.
I am trying
If IsNull(Me!ShopOut) Then Me.StillinShop.Visible = True Else Me.StillinShop.Visible = False End If
however, it shows the box whether there is a date in ShopOut on not. Is it possible to do this in a continous form or do i need somekind of me.record#.ShopOut or something.
I want to show/hide a button on my form.The button is for entering a new record in the table of the database.Now when i Load the form, i want to check if there are already records in the table for a specific lanID. When there are no records, the butten has to be displayed. When there are already records for that lanID the button has to be hidden.
I have found some code to tackle that, but When i use the rs.MoveLast it hides the button when there are records, but when there are no records it gives an error that there are no records found. I almost forgot to say that i use Access 2010..Here is the code that i use:
Code:
Private Sub Form_Load() Dim SQL As String Dim rs As DAO.Recordset Dim landmeterID As String landmeterID = [Forms]![MainForm]![LanIDTxt] SQL = "select * from dbo_Lan_Opleiding where Id_landmeter ='" & landmeterID & "'" Set rs = CurrentDb.OpenRecordset(SQL)
I have a form that has a listbox and a subform. The listbox lists names of events, start date and end date. The subform bellow reveals names of participants to the event that is clicked in the listbox. Against each participant's name is a button to delete the participant.How can I hide or disable the delete button if the start date of the event is past?
I have been working on this for awhile, and can't figure it out for the life of me!
I have a form set up with a drop down box that lets me pick from values from a table based off of the Primary Key of that table (Row Source = SELECT Order.OrderID, Order.OrderName from Order). I have a button on the form that I want to set a value (Closed) from the table entry based off of the order selected.
Pseudo code would go something like this.
Closed.Value = True Where Table.Order.OrderID = SelectedOrderID
Table.Order is a Table Named Order (obviously) Closed is a yes/no field in my Order table OrderID is the primarykey of the table Order SelectedOrderID is the drop down box.
I, unfortunately, have been singled out as the Access guru in my work area. We have 223 people and the Information Manager has tasked me to modify a database he "found" to be able to track a number of things, but most important to him: performance reports.
I have posted the sample of what I currently have. What is being asked of me is a way in which to have a button or by double-clicking a block where a date would go for all other dates on the form to become non-visible while the current date stored in the computer the database is being worked from be entered in the block where the button or double-click happened. All this links to a report for the IM to be able to track what performace reports are out, and when they are due back to his section. He also wants me to be able to show which are overdue and where they are at. I am not sure if it is at all possible, but with me having spend most of last week purusing the articles on Access here, I know now that nothing is implausible if you happen to go about it the right way.
Since I have read the rules on posting, here is what I have done. I searched the forum for command button and got a lot of really cool ideas to use elsewhere in the database. I looked up the help in the program itself for command button, and got some good information on how a command button works, but I cannot make it put a date into a block. I can enter the date in any block that is a date format, but then I have dates in every block. He only wants to see the most current date in any of the blocks.
Any assistance at this point would be appreciated. If I have missed something in another thread, I apologise in advance.
A couple of weeks ago I asked the question of how to send a single record from one table to another (Archive table) using a command button. I got a response. I have had time to work with this a little. My problem is I keep getting a error message "Run-time error '3075'; Syntax error (missing operator) in Query expression "[New ID]='. I wanted to mention that the archive table has an "archive ID" field as well as "New ID" that links the tables. I have the following code. Please help with this if possible.
" Private Sub Command667_Click() ' Save the main record if it has not been saved. If Me.Dirty Then DoCmd.RunCommand acCmdSave Me.Recalc End If
If MsgBox("Do you want to archive this record?", vbYesNo) = vbYes Then Dim SQL As String
' Move main record to Grants Activity Archive. SQL = "Insert into [Grants Activity Archive]" & _ " select * from [Grants] where [New ID]=" '" & Me.ID & "'" CurrentDb.Execute SQL Me.Recalc End If
End Sub "
The error seems to refer to the & Me.ID section. I have tried putting Me.New ID and also Me.Archive ID. The Grants Activity Archives is the subform where I want the record to go. This subform is set up like a form with many fields so it is a lot of work to type the main record from the Grants table to the Grants Activity Archive table every time you want to archive a record. I hope that makes sense.
This is perhaps a simple question for which I have not been able to find an answer to. I've been trying to create a form which contain command buttons, but the problem is that the look of these buttons are not similar to those found in Windows XP.
I know it’s purely cosmetic :cool: - but how do I make my buttons in Access 2003 to look like those on my Windows XP?
I've seen some samples here on these forums which have the 'XP' look. Any hints on how to do this would be greatly appreciated.
Hi I have a option group with 6 command buttons. The trouble is when you select a button, the button stays selected, so if you want to select it again you have to select another butoon then go back to it (hope this makes sence!). Is ther a way to re-set the button so it returns to un-selected mode!!!! Thanks in advance!
Question One I want to create a command button in the form view that once pressed opens a folder that contains a photograph. I assume that I need to use a hyperink but how is it done?
Question Two When in the form view and I press a 'Find ' button that I created I want to have a combo box/list box on the find. The alternative to this is that the reader has to remember all of the subjects. With a combo box/list box, or similar, the user can scroll down the list and pick and choose the subject to search for.
I would greatly appreciate any assistance on either question.