I have a form (employee info) that requires the user to do a search to find the employee before then editing anything that needs to be edited.
I have a search box that will find the relevant record without any problem, however what I am looking to do is hide text boxes on the form and have them appear only once the search has found the matching record.
If no matching record is found, I would then like a message box that states 'No matching employee, would you like to add an employee' and when the user clicks OK, it then reveals the same hidden text boxes and sets focus to the first one of the bunch.
Now, I have used the 'me.textboxname.visible = True (or False) elsewhere, however, I am not sure how to trigger that after a search.
I assume I am looking at an If statement, but I am not sure how to construct it, hence turning to the experts.
Code:
Private Sub txtEmployeeSearch_AfterUpdate()
If txtEmployee = DLookup("EmployeeNumber", "tblEmployeeInfo") Then
Me.txtboxname.Visible = True
Me.txtboxname2.Visible = True
DoCmd.GoToControl "txtboxname"
Else
MsgBox "Employee Not Found", vbYesNo
<<<<<<<<<<<<<<<<<<<<<<
End If
End Sub
I know that there is a massive gap where I have put <<<<<<<<<<<<<<<< - but I am stumped as to what to put in there?
I am using Access 2010. I wish to show or hide controls based on the value in the combobox. The combobox is bound with the data type Yes/No. If Yes, controls should be visible and if no, they are to be invisible. The database is a linked one. This selection should update all the users' forms.
I have a report base on my table. Here a check box. I wanna show two label text hide/show base on when check is true or false. It will be when report will be open. I have try this but nothing is happened.
Code: If AffecteAc= True Then affected.Visible = True general.Visible = False End If
I have a form with two text boxes and a button. I want to be able to type a value into the first Text box click the button and the second text box to be filled with the value which is stored in the Table.
The first Textbox is called barTxt, The second Textbox is called CustTxt The button is called SearchBtn and the Table is called BookInTable. I have been trying to use the code.
Code:
Private Sub SearchBtn_Click() DoCmd.FindRecord Me.BarTxt.Value, , True, , True CustTxt.Value = "SELECT BookInTable.Customer FROM BookInTable " & _ " WHERE Customer = """ & Nz(Me.BarTxt) & """" & _ " ORDER BY Customer" End Sub
This however instead of displaying the Value for customer which is stored in the BookInTable. Displays The code SELECT BookInTable.Customer FROMBookInTable " & _ " WHERE Customer = """ & Nz(Me.BarTxt) & """" & _ " ORDER BY Customer"
I've created a form with two textboxes and a listbox. What I want to do is to show in the listbox the registers filtered by the 2 textboxes. But I would like that the listbox refreshes while typping in the textboxes.It was no problem to do filtering with only one textbox. The rowsource of the listbox is a query in which I set in the criteria Like [Forms]![Form1]![Textbox1].[Text] & "*"Then I write the code for the change event of the Textbox1:
Private Sub Textbox1_Change() Listbox1.Requery End Sub
With this I have no problem. The problem is when using the 2 textboxes. I write the same in the criteria, Like [Forms]![Form1]![Textbox2].[Text] & "*", on another field but it doesn't work. I also write the code for the second textbox:
Private Sub Textbox2_Change() Listbox1.Requery End Sub
The listbox doesn't filter with both textboxes. When you type in one of them, the listbox filters from it, but when you type in the other textbox, the listbox shows the whole table filtered with the characters of the second textbox.
I have a pair of captioned text boxes for taking the criteria for the search result. Currently the text boxes are tied with a date field. I would like to give the user's choice of a number of date fields. After some research, I believe option group control fits for this purpose. Unfortunately, I never try this function before.
i want to search a phone number in contact information table with column names - number, name, address, dob, gender, f-name, m-name etc and show them in a form with each field in separate text boxes in access 2010.
I've got a main form with two lists boxes. I want to show the visible columns in my subform (which is a datasheet) in one listbox and show the hidden columns in the other. Also I want to allow the user to hide / show columns using right or left arrow buttons between the list boxes. My subform is bound to a stored procedure using ADO.
my problem seems to be very familiar to the one in this thread :
[URL]...
Basically I have a list of tables in one combo box. I want the user to select which table. ( The tables are stock information, each table for each different day of the stockmarket)
Then they select the Stock they want to look at. ( These are the same in all the tables obviously, so it is the same in the drop down box)
NOW, the bit i'm struggling with. Is for a textbox below to show the value found IN the table name selected, with the stock selected. How would i do this in SQL, or VBA with SQL.
I have a form called frmPO based on a table called tblPO One of the fields in tblPO is linked to the field idAddress in the table tblAddresses
The following fields exist in both tblAddresses and tblPO Company Address1 Address2 City ZP State
The form contains controls for these fields on tblPO. I would like to give the user the choice to either enter a shipping address manually, or selecting a preregistered address from tblAdresses. For this I would like a combo box showing the values of idAddress. I f a user selects a preregistered shipping address, I would like the form to fill the rest of the fields based on the value of this control.
My understanding is that I should set a BeforeUpdate event to set the values of the different controls, unfortunately my command of VBA amounts to 0.
I am trying to get the text in a couple text boxes to turn green if a certain Yes/No field is left blank.
I know the conditional formatting is working, because condition 1 and 3 are working fine (those expressions are referencing text fields).
I would like to have Condition 2 look at [DM_Approval] from the bound query and if it is unchecked, execute the conditional formatting.
I've tried all kinds of statements, but i'm starting to think that the expressions in the conditional formatting window just won't work when referencing a yes/no field.
Specifically (at the very least) i know i tried [DM_Approval]=False, [DM_Approval]=No, [DM_Approval]=0, and [DM_Approval] is null.
I'm trying to build an database for aircraft operators. I've got the basic tables structure and relationships but I'm stuck on building an search form to filter records by user input.I've got following controls on my form (unbound):
1. AircraftType (combo box) from tblAircrafts 2. CompanyName (combo box) from tblListOfAircraftsOperators 3. TeailNumber (text box) from tblAircraftOperators 4. AirportNameSearch (combo box) from tblAirports 5. PassengersNumber (text box) from tblAircraftOperators 6. ManufactureYear (text box) from tblAircraftOperators 7. SourceSearch (combo box) from tblInfoSource 8. CountrySearch (combo box) from tblCountry 9. CategorySearch (combo box) from tblAircraftCategory 10. EamilToOperator (text box) from tblAircraftOperators 11. InteriorPhoto (Bound object frame) from tblAircraftOperators 12. ExteriorPhot (bound object frame) from AircraftOperators
I need to enable users to search for aircrafts based on those criteria. As I mentioned I'm new to Access and I don't have any advanced coding skills. I have a query build to perform the search and this is the code I've managed to write so far:
I would like to know if the following is possible: I have a table, I have a form based on that table (datasheet view) and I would like for certain columns to visible or not based on the input on a Combobox (list of countries) that is based on another form.
I have searched on the web and I found that the following:
On a button based on the main menu form:
Code: Private Sub Go_Click() Dim stDocName As String Dim stOpen As String stOpen = Me!cboDest stDocName = "Datasheet" DoCmd.OpenForm stDocName, , , , , , stOpen
and then on the event "on open" of the form Datasheet I have inserted the following:
Code: Private Sub Form_Open(Cancel As Integer) Select Case OpenArgs Case "USA" Forms![Overflow]![Tasks].Visible = True Forms![Overflow]![Constant Number (Min)].Visible = True
[Code] ....
I have done it as a test, but it appears that it does not work. It opens the forms, but it does not hide or show the columns based on the option, it brings all the columns.
I have a continuous form (2003) with 6 text boxes (StartTime, StopTime, Comments etc...). I would like all the text boxes to have a gray background if the StartTime for that row is less than Today().
I am trying to make a search option in my form header. Right now I have two unbound combo boxes (CboAccountsfilter and cboCourseName) that I can use to filter my records. Currently, I can use the drop down for CboAccountsfilter and a list of accounts will appear. When I select one, the corresponding Course Names will appear in cboCourseName. This works fine...Code below. I would like to take the filtering a step farther and add checkboxes to filter the data. I my form, there currently exist several check boxes (yes/no)...(Priority, Rep Top Target, Manager Top Target, ect). I would like to have the option to use a check box to filter. I.E if I had a checkbox in my header called PriorityFilter, if checked it would only bring up those records that met the two combo boxes criteria and was a priority.
Below is the code I have so far...it doesnt have anything for the checkbox because I am at a lost of how to get started.
Private Sub CboAccountsfilter_Change() Me.Requery Me.cboCourseName.Requery Me.Check178.Requery End Sub
Ok, nobody chew me out... I know there's over 500 posts regarding calendars on here because I've read just about every single one and haven't found any answers yet. All of the posts that vaguely resembled what I'm looking for had no replies.
Here's what I'm trying to do:
First I've got 4 tables, each has different data including a start date, start time, end date, end time and description. Each table pertains to a completely different subject. The tables are already populated (imported from excel).
I've got a form with a calendar control (Ms Cal 7) in it... and that's about has far as I have gotten.
I would like to be able to open the form and have the calendar show all events for the current date (i found how to make the calendar show the current date, it's just populating the text boxes that I'm having a problem with).
So, here's how I would like it to work...
When the form is opened, you can click on a specific date (or don't click anything and it shows the current date). Then the textboxes show the info for that date.
Example:
Calendar = 4/20/2005 (Calendar control here)
Textbox1 = select from table A where subject="codereds" and start date = calendar control date
Textbox2 = select from table B where subject ="codeblues" and start date = calendar control date
Textbox3 = select from table C where subject="codegreens" and start date = calendar control date
Ok, anybody got a clue on how I can do this because I've had no luck finding it anywhere.
I have a form where I want a textbox [txtMaxOrdLimit] to be visible only if another text box on the same form [PaNumber] contains the letter D in the string. This is the code I have on the forms On Current property but I'm missing something because textbox [txtMaxOrdLimit] doesn't show on the form at all.
If Me.PaNumber = "*D" Then Me.txtMaxOrdLimit.Visible = True Else Me.txtMaxOrdLimit.Visible = False End If
I have query that creates table with 2 records each with 2 columns (2x2) and they do not have indexed ID,and query is related to combo box in other form so results are not always same but it is always (2x2) and value types are always same,
So how to show those results in text box in form,lets say 4 text boxes ,every value in one text box, i assume that i need to use DLookup() but i was able only to show first record,did not know what criteria put to go to second record.
When i select that query and create report i get what i want but i cant copy those text boxes to form that i want.
I have a table of data regarding companies (contact info, etc). The company I work for provides these companies with up to 10 different products. On my input form, I have created 10 check boxes (and thus, 10 columns of Yes/No data in the corresponding table).
Each company has at least 1 product checked off, and up to all 10.
I would like to create a combo box that lists all 10 products, and upon selecting one, a list box then populates with the names of the companies (primary key) that use that specific product.
So, for example,
Company A buys CATS and DOGS from us Company B buys DOGS Company C buys CATS and ELEPHANTS Combo box options: CATS, DOGS, ELEPHANTS
If I choose DOGS, then a list box gets populated with:
Company A Company B
and when I click either of these, the record should be brought up for the respective company.
All of this should take place in the header of the form, while the form itself can be updated based on search selections.
I have a database with a main menu which opens up on start-up it works fine and all but I want to go the extra step, I wish to disable / hide the ribbons (Top and Bottom) - Or Hide the whole Microsoft Access Window and display my form with the desktop behind it.
The next thing is once I click the X or the button to close the form I want Microsoft Access to appear again as in everything to show itself again.
I currently have 3 tables within a database with student details of three different classes. I need to create a user form that has a dropdown box which I can select a student from one of these tables with a number of text boxes below which brings up all the students details, then once the student has been selected and the correct details are shown then I need to create a button which allows me to move that student from one table to another.