I need help! (1 Viewer)

tmruiz

New member
Local time
Yesterday, 18:54
Joined
Jun 11, 2015
Messages
5
I am in desperate need of help! I have been working on a database form and cannot get it to work.

In my table, I have two fields (Region and DBMonth) that I need to use in conjunction to put data in specific places. In the form that I created I have DBMonth as a command which I can either move to or back to any month that I need. I have used Region as a listbox. What I would like to happen is to use the listbox and the command buttons together so that I can enter data into the correct area. Right now, the Region data is being rearranged according to how I use the command buttons.

Any help that you can send me would be greatly appreciated!
 

MarkK

bit cruncher
Local time
Yesterday, 16:54
Joined
Mar 17, 2004
Messages
8,186
I don't understand your description of the problem, or your description of the outcome you are seeking.
 

tmruiz

New member
Local time
Yesterday, 18:54
Joined
Jun 11, 2015
Messages
5
I have both a list box and command buttons in my form. Command buttons are used to move from month to month and the list will allow users to select a Region. How can I code so that if I select a Region AND select a Month, it will go to the correct field for the data?
 

Adam Caramon

Registered User
Local time
Yesterday, 19:54
Joined
Jan 23, 2008
Messages
822
Unfortunately that is not enough information to provide you with a solution. If you can post the fields of the table that the form is based off of, as well as any code behind the button you're using to enter data into a field, we might be able to help.
 

MarkK

bit cruncher
Local time
Yesterday, 16:54
Joined
Mar 17, 2004
Messages
8,186
Command buttons are used to move from month to month
Move what from month to month? How is a move implemented? Do you change a value in a field? Do you move a value to a new field? What value? What field?
 

tmruiz

New member
Local time
Yesterday, 18:54
Joined
Jun 11, 2015
Messages
5
The fields are set up as the following:

ID BusinessUnit Region DBMonth AvailabilityActual
1 PCC THPP January 1.25

The Regions have 3 regions included. The way the table is set up each Region will have a month of data associated with it (i.e. THPP will have all of January's information for all fields.) The next record will have another month's of information, etc. The command button is designed to be able to move from month to month (record to record). This was working perfectly when I had one region.

Since there are additional regions, I have included a list on the form to be able to select the Region. The idea was to be able to select the Region and then be able to move from month to month (or record to record).

The command button will work. The list box will work; however, when used together, any data entered into the form will not populate in the correct field. So if I put in my list box THPP and March using my command buttons, the data may end up in another region in another month.

I hope this helps. I don't know really how else to explain it.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 18:54
Joined
Feb 28, 2001
Messages
27,308
You have to consider at least one more button. You have date-move (+1 month or -1 month) and you have a list-box But until you select both a date and your region, you are not ready to do anything. So you need one more button to say "OK, Do it!"

Alternatively, if you want to run the operation without that extra button, you would have to do something like put some code in the list-box .LostFocus routine and then not use it until the date has been selected. However, if this is to be used by multiple people, you have to consider the Yale Law of Animal Behavior: Left to themselves and in the absence of physical constraints to the contrary, people will do as they damned well please. So the .LostFocus idea probably wouldn't work given the perversity of people.
 

tmruiz

New member
Local time
Yesterday, 18:54
Joined
Jun 11, 2015
Messages
5
Doc Man, you are awesome. I will try the extra button method. Is there some special code that I need to look at?
 

JLCantara

Registered User.
Local time
Yesterday, 16:54
Joined
Jul 22, 2012
Messages
335
Validate the info: make sure you have a month and a region before 'doing it'.
 

Users who are viewing this thread

Top Bottom