Using an event to change color of text.
Im looking to give the users of a form some visual cues indicating in what order combo boxes need to be clicked. Even though the order is a straight forward top to bottom sequence, I believe in going the extra mile.
So say the object is a label and is named lblCategory. Is there a VB command that will change the label's text color? Then Its just a matter of me putting that command into the proper event in the corresponding combo boxes, which I can handle.
Pointers for Inventory for Inventory DB
I'm creating a DB to handle inventory and ordering for a restaurant and wanted some advice really on what things I might need to look out for , common newbie mistakes in an inventory DB etc.
I am already unsure how to handle some things though. particulary with the prices and value of my items
I have products in stock which I will need to enter as an initial inventory. Now some of these may have been purchased at different prices but I'm prepared to enter them at a single price per product for simplicity sake.
The confusion I have is how do I handle in the design the changing prices of products. for example chicken, is something I buy a large amount of about 3 times per week and the price changes most days , so the value of the chicken I have in stock needs to reflect this somehow.
parameter.add - How do you handle null or empty values?
Can you tell me how to handle processing when parameter.add adds a parameter in which the value is null or empty?
In my code I add this parameter:
I thought that String = Nothing gives them a default value.
As a quick fix so I can import the data I made sure if any parameter was null I would pass it a single space character but is that the best way to handle that scenario?
Password Command button on a switchboard
I created a command button that will not open unless a password is put in. For some reason my command box is gone. I can still see the previous command button instructions in VB, but I can't get figure out how to re-attach the command to the button.
Command List Question
I've been searching the net & MS's site for about an hour and can't find what I'm looking for. Maybe I'm not phrasing it right or something - please help! ^_^
All I want is a list of the commands under the Run Command option that explains what each command does. I can't find stuff in my manuals or through the office assistant. Does this exist anywhere
Advice on best way to handle data
I have a database that has several forms and table to track Research Studies and Patients. I would like to be able to add new research trials from a form that I guess would then create a new table? I am not sure if that it the best way to handle this.
I have table called "ElementsLibrary" and in this table is where I put all the parts of an actual exam. So on a form I would like to be to select the elements from the library that are going to used for the research study (each trial uses some of the same "elements" but there is always new elements being added to the library which are individual to the specific research trial).
I have searched for 2 days to try and find a solution but have had no luck, I did read several post on other sites where people were told not to have a command button create a new table. So I am lost.
I am open to any suggestions on the best way to tackle this situation
add record with data from form and VBA ??
I can figure out a work around but would prefer to learn how to handle this correctly.
I want to add a new record through a form and when the user has completed the fields they can click on the Add command button. When this happens I would like to add data to two fields not included on the form.
I want to add the current date and also a status of "Ready" to another field. This would happen without user interaction but when the record is being added.
I have tried an update tablename and set field value but could not get the syntax correctly or something because I kept getting an error.
For this example let's say the table is TableName and the date field is AddDate and the status field is Status.
I also want to add code to the command button that saves the record and then closes. I have that code that works but should I update the two fields before saving therecord or use the save record command first and then update the two fields ?
How to handle unknown number of variables?
Forum, Access 2000
I am working with sending emails to customers on their loan account balances.
Have sorted out an email to cover a Loan which by definition is One Record.
Now I want to email a Customer Balance which may have more then one Loan Record.
How do you handle this scenario in vba as you can't just load the code with heaps of variables just in case they are needed.
Is this where you use an Array
I am testing Arrays with some success and a little failure but of course, how do you handle the data in the email message as again, it can have a variable number of lines/records.
Using ReDim Arrayname(intLower To intUpper) to set the Array size to suit the record number - Is this how you would do it?
I could use a table to hold the data but then we still have the issue of the email text / body
Use a command button to start an action or a series of actions
You use a command button on a form to start an action or a set of actions. For example, you can create a command button that opens another form. To make a command button perform an action, you write a macro or event procedure and attach it to the command button's On Click property. You can also embed a macro directly into the On Click property of the command button. This makes it possible to copy the button to other forms without losing the functionality of the button.
What do you want to do?
* Add a command button to a form by using a wizard
* Create a command button by dragging a macro to a form
* Create a command button without using a wizard
* Customize a command button
Minimize Command Ribbon in a Form Event?
I have a Form 'Periodic Analysis', which because of its' layout requires me to minimize the 'Command Ribbon' to allow all the data to be displayed without scrolling.
I would like to have the 'Command Ribbon' minimized while the Periodic Analysis Form is open and have a macro re-instate the command ribbon when the Periodic Analysis Form closes. I cannot find any commands to do this. I can do it manually but would like it to be automated with the macro. I would do this as 2 Events in the Form itself using 'On Open' and 'On Close' in the 'Forms Properties' window.
I have no skill with VB and am just learning Macros
I have a variable from a form. I am trying to take that varaible (street name) and split it into individual varaibles based on the spaces.
ex: 64th Ave N
I need this into 3 varaibles.I tried this and know I need more to handle the array created by a split command but cant figure it out
hidding group commands in ribbon and setting password with vb
All this is for access 2007
I can manipulate the access default ribbon tabs and groups but is there a way to, for example, hide a command in a Tab's group? For example, are we allowed to hide the 'linked table manager' command in the 'Database Tools' group? If so,
Second thing. How to use the RunCommand acCmdEncryptDecryptDatabase command to set a password/encrypt a database? When I use it from a button on a formi get an error message saying that it is not available right now, however, the 'encrypt with password' command in the ribbon works just fine.
On Timer Subform Refresh..
I was hoping that someone may give me some tips how to handle a subform refresh.
here's the background, I have a drive schedule that many people can update, currently if you click on the calendar it refresh's a subform that displays that days info. Thing is unless you click the calendar no refresh occurs and so if someone adds a job it isn't displayed.
What I was thinking is using the On Timer event to perform a requery on the subform. something like Forms("MainFormName").SubformControlName.Form.Requ ery.
every 2 mins or so.
firstly is this the best way to handle this? or is there a better way. & if it's ok how in vba might I code a timer event
programmer that I am, I'm at least familiar with the importance of error handling in my code. However, I'm unfamiliar with best practice.
Currently, I error handle every sub. Like below (modeled after what comes in the sample MS Access databases for error handling).
Private Sub cmbSample_AfterUpdate()
On Error GoTo Err_cmbSample_AfterUpdate
'Here is a bunch of code
if x then
This seems cumbersome to me. Seems like I could have a public sub just to error handle and my on error statement could just be "on error publicerrorsub" which then grabs the error and displays it (if that's what I want).
Best practice I should be following? General advice
how to prevent running OnExit procedure, if pressing Cancel Command?
A textbox has an OnExit procedure that I don't want to run, if I pressed "Cancel command" button (a command button that I want to dedicate to this role).
before Cancel command button takes the focus, anyway the procedure linked to the OnExit event of the text box RUNS!
Is there a way to intercept the command button pressed, before OnExit runs? KeyDown traps only the keys, not the command buttons. Though should be something similar.
MouseDown runs only after the textbox's Exit proc
can access handle huge volume of data upto 2 crores???
Does Access 2007 has the ability to handle 2 crores of data in a single database file? ( I am using layers of query over the tables and queries).Because MS Access is hanging
Handle reserved words in table column name
As described in the following code I have an access db and I am trying to add a record to it.
Whosoever designed this database has used reserved words like name, date, time etc to name the columns of the table.
What is the syntax to handle the reserved words?
VBA code for Command buttons on child form
I am very new to Access 2003 and I've run into a problem with the command buttons on one of my forms. I have a main form that has a command button that opens up a second form, on the second form my Record Navigation 'go to previous record' and Record Navigation 'go to next record' buttons do not work, I receive the error: You can't go to the specified record.
However, when I open this second form up by itself these buttons function as they should.
@AccessMSSQL mentioned that when I open the second form through the command button, this may cause only one record to be displayed so I can't move to next or previous.
Back color code for a command button
I created 4 command boxes, 1 list box, 2 textboxs and 1 combo box in a form. I wanted all boxes have the same look like the command box. However, I tried different grey colors but still could match the command box's back color. Would someone know the exact back color code for a command box?
Filtering the same data in different ways
I'm working on a database about crafts and one of my forms will allow people to filter Yarns by color, thickness, or fiber content. I thought the best way to do this would be to put a copy of the form onto 3 Tab Controls and have a combo box one each one that would allow the user to select of the yarns that meet that set of criteria.
So, on the Color Tab, the combo box lists all the color families. The user picks a color and is shown all yarns of that color family.
Another tab would have the thicknesses and the third tab would allow one to see all of the wools OR all of the cotton yarns.
I'm having a problem, so I'm asking if this is a feasible way to handle filtering of items like this.
What would be the best way to handle these multiple searches?