473,408 Members | 2,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Using a switchboard control to open a parameter screen then access an update form

Hi all,

I've looked for an answer for this in lots of books, online in several discussion groups and have not found the answer which I feel may be very simple.

What I want to do is have a switchboard with several active buttons on it for entering new data, updating data, reports etc. The new data and report stuff is easy, but the update button has me baffled.

What I want to have happen is when the update button is clicked, a parameter msgbox will pop up asking for a specific unique number/letter combination. This is called a DOT Number. Each record has a DOT Number which is unique to that record with no duplication in any other record.

Once the parameter box opens, the user will have to type in the specific DOT Number for the record they will be updating. Once they have entered the number then they would hit a button that would open up the one and only form in the database.

The form consists of the main form where new records are developed, and a subform for updating various activities that are specific to the main record.

Once they are done doing their updates and saving them, then they would hit a command button that would close the form and take them back to the main switchboard, or they could hit another button that would open up the parameter box we previously discussed so they could type in a new DOT Number and it would bring up the proper record for updating.

Is all of this possible. I am fairly new to database building, but am learning fast. I'm pretty shaky with VBA, but again slowly but surely learning.

Thank you all so much for any help you can give me on this last thing I need to do before turning over the database for testing.

Rick Flink, i.e. the Grizz!
Jan 31 '07 #1
9 3311
NeoPa
32,556 Expert Mod 16PB
Firstly, I think all you've described is possible.
There may be alternatives which are more suitable though.
  • It is usual for an operator to enter a key or search criteria in a TextBox (or even select from a ComboBox) on the form itself before loading up the relevant record details (See Example Filtering on a Form. for a Tutorial on this concept).
  • Updating records on a form is normally done by simply moving off that particular record (this is the natural Access way using Bound forms) and this could be done programmatically (as in behind a Command Button) if required. It is also possible to create and update the data using RecordSet objects in the code. Needless to say, it's easier doing it the Access way.
Jan 31 '07 #2
Firstly, I think all you've described is possible.
There may be alternatives which are more suitable though.
  • It is usual for an operator to enter a key or search criteria in a TextBox (or even select from a ComboBox) on the form itself before loading up the relevant record details (See Example Filtering on a Form. for a Tutorial on this concept).
  • Updating records on a form is normally done by simply moving off that particular record (this is the natural Access way using Bound forms) and this could be done programmatically (as in behind a Command Button) if required. It is also possible to create and update the data using RecordSet objects in the code. Needless to say, it's easier doing it the Access way.
I'm sorry, I didn't explain myself very well I think. The basic information that is originally entered into the database via the main form will not change. What this main information represents is a railroad crossing area, where we have had multiple incidents over a period of three years.

The update subform will be used to submit what type of activities our managers have done to lessen the chances of additional incidents occurring in this location. These activites will be tracked by date and type basically.

The tie in of course is that the subform is tied to the main form through child/master links. The only real unique field is the DOT Number field so that is what I want to use as the way to get to the proper record for updating purposes.
Jan 31 '07 #3
NeoPa
32,556 Expert Mod 16PB
The unbound TextBox (or maybe ComboBox would be better for your situation) solution I suggested is merely for selecting the DOT number you're interested in. I don't see this would be in any (material) way different from a popup input box.
Unusually ;) Your post is actually quite clear and well expressed. Unless I misunderstand you still, both ideas would be appropriate for your situation. I'm not suggesting you need the full complexity of the filtering found in the Tutorial. Simply a single unbound control that would allow you to select a DOT number which is then the active one.
Feb 1 '07 #4
ADezii
8,834 Expert 8TB
Hi all,

I've looked for an answer for this in lots of books, online in several discussion groups and have not found the answer which I feel may be very simple.

What I want to do is have a switchboard with several active buttons on it for entering new data, updating data, reports etc. The new data and report stuff is easy, but the update button has me baffled.

What I want to have happen is when the update button is clicked, a parameter msgbox will pop up asking for a specific unique number/letter combination. This is called a DOT Number. Each record has a DOT Number which is unique to that record with no duplication in any other record.

Once the parameter box opens, the user will have to type in the specific DOT Number for the record they will be updating. Once they have entered the number then they would hit a button that would open up the one and only form in the database.

The form consists of the main form where new records are developed, and a subform for updating various activities that are specific to the main record.

Once they are done doing their updates and saving them, then they would hit a command button that would close the form and take them back to the main switchboard, or they could hit another button that would open up the parameter box we previously discussed so they could type in a new DOT Number and it would bring up the proper record for updating.

Is all of this possible. I am fairly new to database building, but am learning fast. I'm pretty shaky with VBA, but again slowly but surely learning.

Thank you all so much for any help you can give me on this last thing I need to do before turning over the database for testing.

Rick Flink, i.e. the Grizz!
The simplest, but not necessarily the most efficient, solution to your problem is as follows:
__01 Edit your Switchboard Item (Button) in the following manner:
______A Text: Open <your Form Name here>
______B Command: Run Code
______C Function Name: fSearchForDOTNumber
_02 Clicking on this Switchboard Button will now run the code below. This code is for display purposes only, you must substitute your own values in the code to work within your context:
Expand|Select|Wrap|Line Numbers
  1. Public Function fSearchForDOTNumber()
  2. Dim strResponse As String
  3.  
  4. 'Here is your Prompt
  5. strResponse = InputBox$("ENTER the DOT Number to search for", "DOT Number Search")
  6.  
  7. 'User pressed Cancel or OK with no value entered, get out of Function!
  8. If Len(strResponse) = 0 Then Exit Function
  9.  
  10. 'If the next line = TRUE, then no DOT Number exists (make necessary substitutions in your code). Inform the User of this and exit the Function.
  11. If IsNull(DLookup("[LastName]", "tblEmployee", "[LastName]='" & strResponse & "'")) Then
  12.   MsgBox "The DOT Number " & strResponse & " does not exist in the Database", vbExclamation, "No Record Found"
  13.     Exit Function
  14. Else
  15.   'The DOT Number does in fact exist, so open your Form in Edit Mode with the specific Record (DOT Number) being displayed. (again, make your substitutions)
  16.   DoCmd.OpenForm "frmEmployees", acNormal, , "[LastName]='" & strResponse & "'", acFormEdit
  17. End If
  18. End Function
'Simply closing the Form at the end of your Edits will automatically return you to the Switchboard. Hope this helped.
Feb 1 '07 #5
Thank both of you so much. It took awhile to figure things out, but I learned a ton and everything works so sweet!

ADezii, I tried your suggestion out, but I kept getting errors, and I am not educated enough in code to figure out what was going wrong. Thanks for taking the time though to help me out!!!!

NeoPa, I studied and studied your tutorial, and finally figured out the logic of what you were doing. I followed your suggestions, started out with a textbox and converted to a combo box. The one thing I can't figure out though is how to get the focus set on the unbound combo box that is being used to pull the proper record out for updating. This is so minor though compared to getting the form to work properly, I'm not worried about it.

Again, thank you both so much for your help!!!

Rick
Feb 3 '07 #6
MMcCarthy
14,534 Expert Mod 8TB
Thank both of you so much. It took awhile to figure things out, but I learned a ton and everything works so sweet!

ADezii, I tried your suggestion out, but I kept getting errors, and I am not educated enough in code to figure out what was going wrong. Thanks for taking the time though to help me out!!!!

NeoPa, I studied and studied your tutorial, and finally figured out the logic of what you were doing. I followed your suggestions, started out with a textbox and converted to a combo box. The one thing I can't figure out though is how to get the focus set on the unbound combo box that is being used to pull the proper record out for updating. This is so minor though compared to getting the form to work properly, I'm not worried about it.

Again, thank you both so much for your help!!!

Rick
To set focus to any control you use

Expand|Select|Wrap|Line Numbers
  1. Me.ControlName.SetFocus
Mary
Feb 4 '07 #7
NeoPa
32,556 Expert Mod 16PB
Thank both of you so much. It took awhile to figure things out, but I learned a ton and everything works so sweet!

ADezii, I tried your suggestion out, but I kept getting errors, and I am not educated enough in code to figure out what was going wrong. Thanks for taking the time though to help me out!!!!

NeoPa, I studied and studied your tutorial, and finally figured out the logic of what you were doing. I followed your suggestions, started out with a textbox and converted to a combo box. The one thing I can't figure out though is how to get the focus set on the unbound combo box that is being used to pull the proper record out for updating. This is so minor though compared to getting the form to work properly, I'm not worried about it.

Again, thank you both so much for your help!!!

Rick
I'm very pleased to hear it Rick.
Messages like that make it all worthwhile somehow :)
I'd answer your last question but Mary has already ;)
Feb 4 '07 #8
Thanks Mary,

I was trying to figure out how to do that for another minor glitch I have going on.

You guys and gals are the best and thanks for helping out a rookie!

Rick
Feb 11 '07 #9
MMcCarthy
14,534 Expert Mod 8TB
Thanks Mary,

I was trying to figure out how to do that for another minor glitch I have going on.

You guys and gals are the best and thanks for helping out a rookie!

Rick
You're welcome Rick.

That's what we're here for.

Mary
Feb 11 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Mark | last post by:
I am looking for a switchboard creator alternative for my MDB. Can anyone help me? Thanks for your help, Mark
3
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
4
by: Rampar | last post by:
I did some customizing on my switchboard (changing colors and adding graphics) to make it more appealing. I tried to add another item, and it told me that 8 was the limit. Fine. I deleted one...
1
by: Big Time | last post by:
I have a form that is based on a parameter query that needs to be opened in datasheet view. I have set the default view to datasheet and disallowed all other types of views other than design view....
1
by: Norman Fritag | last post by:
Hi there I have avoided to use active x controls because I thought they are causing more problems then they are doing any good. I a new application I would want to use the tree and list view...
8
by: Ray Greene | last post by:
I was working in Access and everything disappeared from the screen. When I closed and reopened the file there was no switchboard. I can open tables and forms etc if I select a category from the...
4
by: Jim Hammond | last post by:
It would be udeful to be able to get the current on-screen values from a FormView that is databound to an ObjectDataSource by using a callback instead of a postback. For example: public void...
1
by: Yetti | last post by:
I would like to create a switchboard showing all tables that would open each table upon selecting the control box. The switchboard manager does not appear to allow you to select specific tables as...
5
by: sierra7 | last post by:
Hi I have been writing Access applications for some years now and have moved away from from the 'Switchboard' type of opening form to using a menubar accross the top of the screen and borderless...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.