I have a form to add, edit, and delete Records from a table. I am using the following VBA
Private Sub cmdEdit_Click() If Not (Me.frmlEmpDetailsSub.Form.Recordset.EOF And Me.frmlEmpDetailsSub.Form.Recordset.BOF) Then With Me.frmlEmpDetailsSub.Form.Recordset Me.txtAddEditname = .Fields("Name") Me.cboRoster = .Fields("Roster") Me.cboPermFctn = .Fields("PermFctn") End With End If End Sub
Instead of referring to the Subform to load the data i would like to refer to a combobox:
cboSearchName
Its not an issue but This Combobox contains 5 columns...
I have a continuous form with a button(delete). on click event I want to delete a record on another table. I though about doing this via a delete query. The sql is below:
I'm an Access newbie and I'm having trouble restricting a combo box on a subform based on the selection of the combo box on the form.The combo box (Combo1) on the main form (FrmOrganisation) gives a list of companies, I want the combo box (Combo2) in the subform (SbFrmEmployees) to list people only from that company. I then have a subform within that subform that displays information about the employee.
I am trying to use a combo box to select the Company in an input record form for my Transactions. In the Transaction table, each record contains the Company ID, but not the company name (I have a relationship with a Company ID primary key in a separate table that has all the companies information).
I would like to be able to select the proper company in the combo box and have the form save the value as the Company ID number with the rest of the input data in a record (it will then refer to the correct company name in the other table if I query it because of the ID key).
All I am trying to do is insert to have a form with a "Delete Record" button on it. The problem is I don't want anyone to be able to delete a record, I would like someone to have to insert a password to confirm the delete.
So I've created 3 tables - one for each information group arranged like so. However my problems are - I don't know how to make it so that as soon as all the info for one set of parts is filled another set automatically appears? And in the Design section of the Form I have the following error because I wasn't too sure what to use apart from a text box-
My combo boxes are not returning the actual combo box values back to my table, instead in the table it is displaying the combo box data list number i.e 1,2,3,1,5,1 etc where it should be displaying a property address.
I need to add new records to a table depending on what the cbo box displays. I figure this is the way to do it but I it's not working, I have only writen the first select,
Private Sub Comando6_Click() Dim dbPalavraChave As DAO.Database Dim rstchaveCFEPC As DAO.Recordset Set dbPalavraChave = CurrentDb Set rstchaveCFEPC = dbPalavraChave.OpenRecordset("chaveCFEPC")
I have a AUCTION form, it has a combo box and the label for this combo box is called seller. This combo box is a look up to the USER table which has the following fields:
uid, uname, city, state
The combo box is pulling and displaying a drop down list of uname from the USER table, with this SQL state in the "row source".
Code: SELECT user.uname FROM [user] ORDER BY user.uname;
In the control source of this combo box I have seller, and the form's record source is AUCTION, tagging on the AUCTION table.
The problem is the form is putting the uname into the AUCTION table's seller field, but I want it to input the uid field, however that it should still show the uname list when the user click on the combo box to make a selection.
I have to combine groups to account, then when account is a group in next time, list or combobox, this group must not to be in that list. what is the solution ? SQL or VB. I append file...
I'm jumping to the forms development and going to try what I need via queries and SQL. I'm trying to do a series of cascading combo boxes which have worked out fine, right till I hit the first junction table.
I will include the VBA code below as well as a screenshot but here's how it goes.
REGION cascades down to COUNTRY cascades down to PORT and then to CARRIER.
This is for a shipping program.
When it gets to PORT and are trying to cascade to the various CARRIER's thats where it hits a junction table of PORT_CARRIER.
Here is REGION to COUNTRY:
Me.cboCountry.RowSource = "SELECT COUNTRY.CNTRY_ID, COUNTRY.COUNTRY FROM COUNTRY " & _ " WHERE REG_ID = " & Nz(Me.cboRegion) & _ " ORDER BY COUNTRY" Me.cboCountry = Null
COUNTRY to PORT :
Me.cboPort.RowSource = "SELECT PORT.PORT_ID, PORT.PORT FROM PORT " & _ " WHERE CNTRY_ID = " & Nz(Me.cboCountry) & _ " ORDER BY PORT" Me.cboPort = Null
PORT to CARRIER:
Me.cboCarrier.RowSource = "SELECT PORT_CARR.PORT_ID, PORT_CARR.CARR_ID FROM PORT_CARR " &_ " WHERE PORT_ID = " & Nz(Me.cboPort) & _ " ORDER BY CARR_ID" Me.cboCarrier = Null
PORT to CARRIER is where the problem is.
It populates the combo box, but with the ID numbers instead of actual CARRIER names.
(the Junction table are two PK fields and are lookups to PORT in PORT table and CARRIER in CARRIER table.)
Is there a magic spell for cascading combo boxes when you hit a junction table?
I have a Table (tblFPAData) that is being populated with entries from a form I created. There are several fields but if I can get an answer for one relationship then I can repeat it for the others.
In tblFPAData there are the fields MaterialNo and Description.
I am creating another table called tblSchedule and using a form to enter the information. I need the user to select the MaterialNo from a combo (cmbMaterialNo) and the then table auto populates the Description from tblFPAData.
Why deletion from a combo box is not working ? I have a control in my form called productid. In the onClick event of this control i have : Dim StrSQL As String StrSQL = "DELETE * FROM [order details1] WHERE ProductID = " & Me!productid & ";" CurrentDb.Execute StrSQL
When i change the control from a text box into a combo box nothing happens and no deletion occurs.However when i change again from como box into a text box the deletion is OK. How can i make the onclick event work also with the combo box ?
I have a create new record from with Employees information taken from tblEmployees. On that form I have a dropdown box of company names taken from tblCompanies. How do I get that to input a ClientID into tblEmployees when I add the new employee? At the moment it just adds a new employee but leaves the ClientID box blank.
I have designed a main form which have buttons for about 30 different companies name to open, each button opens an individual company form. Now the companies list is growing day by day so i want to create a combo box which select the company name and open the relevant company's form.
Do I need to create a table which lists all the companies and then add a combo box on a main screen which select the company name and open the form but i need a VBA code for that.
Where in Access 2010 I can modify the displayed fields of a Combo Box on a form. I need to format the display window and add criteria to one of the fields. Can't remember where I set this up and recently upgrading from Access 2007 isn't working.
Is it possible to have a field (Color) on a form be set to a combo box. A drop-down box appears with Green, Red, Blue, Yellow, Other. When other is selected a dialog box prompt appears asking the user to enter the color. The response is then what appears in the Color field.
[URL] ....I am trying to dynamically search multiple fields from a combo box on a form that includes a subform. I am using code from the above referenced link within this forum.
It works without the "setFocus" for the Listbox except it jumps to a record after the very first character is entered instead of narrowing down as characters are typed. If I leave in the "setFocus" I get run-time error 2110.
I created a new field as a text box, converted it to Combo box, then the Values are pulled from a query and all that works fine.
I have a form that opens and displays these Fields in a Data Sheet view and the new Combo box doesn't drop down and is flagged as a text box in the property bar but no way to change it??
I need the drop down like the other Category field I have, that works but this one doesn't.
See screen shot.
You can see in the Category field, there is a Drop down, but in Category II there is not, even though this is a drop down field. - BUT in this data sheet view it doesn't show it as a drop down.
I am new to access and have been staring at the same Run-time error for 3 days (pathetic I know). I cannot for the life of me figure out why it does not like my Dlookup. Esentially, I want and After Update event in my combo box to populate a Rich text textbox in my form. After reading DLookup is the easiest way to make this happen. Here is my code:
I'm using Access 2010. I have a form that has a combo box. The combo box lists all employee names and one has to be selected. I've been adding employees over time as new employees come. This DB is 3 years old so there are many employees showing in the combo box selection that are no longer here. I'd like to only have the current employees visible but I do not want to just delete them from the Table because then the historic data wouldn't be complete. How can I only show the current employees in the combo box and maintain the data in the table?