Manipulating ListWidth Problem

Sep 8, 2005

Hi all,

I have a problem manipulating the list width of a combobox. Now i set the list width property on the toolbar, as larger then the combobox for instance listwidth = 18.5cm while the combobox is about 10cm. Now i have a combobox that when clicked changes the property of the listwidth back to the size of the combobox. If the user clicks the combobox again it should return to 18.5cm but it does not seem to want to change back, even though all the other property changes work.


Here is my code:
Code:If label1.Visible = True Then Me.label1.Visible = False Me.label2.Visible = True If Me.label1.Visible = False Then Me.Combo.ColumnCount = 1 Me.Combo.ColumnHeads = False Me.Combo.ListWidth = 10 If label1.Visible = False Then Me.label1.Visible = True Me.label2.Visible = False If Me.label1.Visible = True Then Me.Combo.ListWidth = 18.503 'this does not work Me.Combo.ColumnCount = 10 Me.Combo.ColumnHeads = True End If End If End Ifend if

Where if label1.visible = true then listwidth = 18.5 else label2.visible = true listwidth = 10.

Thanks in advance for any help

M-.

View Replies


ADVERTISEMENT

Manipulating Calculated Fields

May 18, 2005

I developed a query that calulates when a contract is reviewed i.e 5 weeks and 9 weeks after the commencement date. These are called CDE1 and CDE2. This works well and the CDE1 and CDE2 dates are displayed ok.

The query above is:
SELECT Contract.ContractNo, Contract.APSNo, Contract.Firstname, Contract.Surname, Contract.AgencyDesc, Contract.FacilityName, Contract.Designation, Contract.WeeklyHrs, Contract.PositionNo, Contract.ComDate, Contract.EndDate, IIf(DateAdd("ww",5,[comdate])<[enddate],DateAdd("ww",5,[comdate])) AS 1stCDE, IIf(DateAdd("ww",9,[comdate])<[enddate],DateAdd("ww",9,[comdate])) AS 2ndCDE
FROM Contract;

The problem is that I now want to access contracts under these CDE dates between two dates that is user defined (startdate) and (enddate).

As the above are calculated fields, how can I develop a new query based on the above as CDE1 and CDE2 are already calculated fields?

View 2 Replies View Related

Manipulating List From Another Form

Nov 19, 2013

I have a button in formA. When I click on it I want it to show the listB.

(To show it I used the event code: ListB.Visible = True)

The thing is, listB is in formB (which is a subform of formA).

Code isn't working because listB doesn't exist in formA, got an error code.

I tried [Form]![FormB].ListB.Visible = True

But it didn't work, I don't think I can do this in an event code.

View 9 Replies View Related

Manipulating Table Data From Code

Feb 12, 2005

I’m working on an Access 2002 project where I need some help with coding. I’m a neebie to Access and Visual basic so a few pointers to get me on my way would be much appreciated.

The project is dealing with logging vehicles on and off site. I have one database that contains a list of all regular traffic in three fields – Registration Number, Company Name and Type. After the last update this contained about 300 records. I called this MAINDATABASE.mdb.

I have another database that runs as a user input screen and front end called WORK.mdb. This contains the above three fields and three others, Time In, Number of Occupants and Time Out.

I have already done the coding for Time In and Time Out where the user just double clicks the field and the system time is entered. The important field is Registration Number. What I need is the following:

When a vehicle comes on site the user double-clicks Time In on the form which inserts the present time (done). The user then tabs to or clicks on Registration Number. An input box comes up where the user types the reg number. I need the code to take this input, search the MAINDATABASE database and if the reg number is found return the values for Registration Number,Company Name and Type in that row of the database and then insert those values into the corresponding rows in the WORK database. If the reg number isn’t found then a message box comes up telling the user to enter details manually and input the string entered by the user into Registration Number field on the WORK database and leave the user to enter the values for Company Name and Type. I have the code for the Input Box and the Message Box at the end!:


Private Sub REGISTRATION_GotFocus()

InputBox("Enter Reg number...")
……..

MsgBox "Registration number not found. Please enter details manually"

End Sub


I just need the stuff to do the work in between!!
Any pointers are very welcome……

View 4 Replies View Related

General :: Manipulating Dates Within A Form

Mar 2, 2013

I've been tasked to create a company client record database which permits several people at once to access and modify a communal database of clients. So far, so good. It's for a firm of solicitors, so I'd better get it RIGHT!!

One field requires the entry of a date, which the next field is supposed to automatically subtract 180 days from.

Is it possible for me to do this within the one entry form? The way I see it is that the first date would be entered, then the form would automatically display the -180 days result in the next box.

View 8 Replies View Related

Forms :: Continuous Forms - Looping Through Records / Manipulating Fields On Form

May 29, 2015

I have a bound continuous tabular form,However, based on data content in one field of a record, I want a checkbox in the same record enabled, so the user can check it if necessary. I have created a record set using the form as shown below, and I am looping through each record. To show that my code is referring to the field with required data content, I display it as a message box and it works, yet my checkbox does not enable.

I have the code in the form_load event, however, for testing purposes I have it behind a button.If I am seeing this properly, the code behind the button enables the checkbox for ALL records once the criteria in the required field is true, and based on the last record, which has no data content, it disables the checkbox in ALL records. I also have the PK ID for each record hidden in the form. Can I utilize that to target the checkbox of each individual record??

Form Detail
-Form does not allow additions or deletions. Edits allowed
-All fields are disabled and locked
-I only want the check box to unlock if data is found in the "RequiredField" as referred to below. I have also tried if not isNull(requiredfield.value) then -enable checkbox, which yields the same results

Here is my code

Code:

Dim rstMyForm As DAO.Recordset
Set rstMyForm = Forms!MyForm.Form.Recordset
rstMyForm.MoveFirst
Do While Not rstMyForm.EOF
If Not RequiredField.Value = "" Then

[code]...

View 14 Replies View Related







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