473,388 Members | 1,177 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,388 software developers and data experts.

Initial Form View to Display Null Values

52
I have an issue where I can’t figure out how to open a form where all the objects within are nulled out until a user selects an appropriate Project Name. My form has several objects (12) within which are pulling info from my Custom Code table. I also have two sub-forms that are tied to two other tables within my database. I have everything working, for if you were to select and or update information it is properly updating the form and or tables accordingly. The problem I have is when the form is initially opened, I can not get all the objects to be blank? When it opens the first row within my table is being displayed. I’d like to have this form open with NULL values until a user selects a Project Name where it then displays the appropriate information from my three tables. I’m hoping I am missing something very basic here but I have been working on this one for two days straight and I can’t figure out how to do it.

Any help would be greatly appreciated.

Birky
Apr 30 '07 #1
11 3966
Rabbit
12,516 Expert Mod 8TB
What about just moving the form to a new record when it loads?
Apr 30 '07 #2
ADezii
8,834 Expert 8TB
It would be a very simple matter to enter Null Values in all Fields when a Form initially opens. The only problem with that is the Null Values would be written to every single Field in the 1st Record - not exactly what you would want. There is, however, an unorthodox solution:
  1. Make an exact copy of your Form (CTL+C / CTL+V).
  2. Set the copy's RecordSource to Null.
  3. Set the ControlSource of every Control on the copy to Null.
  4. Set the Navigation Buttions to No.
  5. What you have now is an exact duplicate of the original Form except that it is Unbound, all its Controls have no Control Sources, and the Form itself has no means of navigation. All Fields on the Form will be blank and probably should be Locked to eliminate any possibility of data entry.
  6. Once the User selects a Project Name from the copy, open the 'real' Form based on this selection.
  7. As stated, it is a little unorthodox but it definately will work until someone comes up with a better solution.
NOTE: Rabbit's idea would be more practical as long as you don't care if the User navigates backwards and displays actual data prior to making a selection from the Project Name Drop Down.
May 1 '07 #3
Birky
52
How do I set it to a new record set when the form opens?

Is it possible to make an unbound form become a bound form once a record is selected?

Thanks for the help on this, I sure do appreciate it.
Birky
May 1 '07 #4
Rabbit
12,516 Expert Mod 8TB
I assume the project data form is a subform? And that the project drop down list is on the main form? If not perhaps you should set it up this way. Just have the subform remain invisible until they make a selection in the drop down box.
May 1 '07 #5
Birky
52
All,

After consulting with my supervisor we believe the option to duplicate the form with disabled object is the route we want to pursue. On that note I have created a copy of the form and have disabled everything except the Project_Name (Combo20) which the user will have the ability to select from a drop down. After the Update of this combo box I have the real form opening which I want to display all the pertinent information for the Project Name (Combo20) they had selected from the copied form (which I hope to be closing after the real form has been opened and has passed the Project Name variable to the real form). Can you help me pass the variable to the new form so the pertinent info is then displayed?

Here is my code from the After Update event of the Copy_Update_Custom_Code form.


Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo20_AfterUpdate()
  2. On Error GoTo Err_Combo20_AfterUpdate
  3.  
  4.     Dim stDocName As String
  5.     Dim stLinkCriteria As String
  6.  
  7.     stDocName = "Update_Custom_Code"
  8. '    DoCmd.Close
  9.     DoCmd.OpenForm stDocName, , , stLinkCriteria
  10.  
  11. Exit_Combo20_AfterUpdate:
  12.     Exit Sub
  13.  
  14. Err_Combo20_AfterUpdate:
  15.     MsgBox Err.Description
  16.     Resume Exit_Combo20_AfterUpdate
  17.  
  18. End Sub
  19.  

Here is the code I have behind my After Update event in the real Update_Custom_Code form. How do I pass the variable that was selected in the Copy_Update_Custom_Code form to this real Update_Custom_Code form? Note I do no have to close the Copy_Update_Custom_Code form, I can just hid it. Does that make it easier to pass the variable from one form to the other?

Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo20_AfterUpdate()
  2.     ' Find the record that matches the control.
  3.     Dim rs As Object
  4.  
  5.     Set rs = Me.Recordset.Clone
  6.     rs.FindFirst "[Project_Name] = '" & Me![Combo20] & "'"
  7.     If Not rs.EOF Then Me.Bookmark = rs.Bookmark
  8. End Sub
May 2 '07 #6
Rabbit
12,516 Expert Mod 8TB
I don't know why you're doing it this way.

Why not just reenable everything on the form when they choose something from the list? Or use the main form subform route?
May 2 '07 #7
Birky
52
This is because even though the objects are disabled they show values within for the first record set of the table. We would like none of the objects filled in when the report is initially opened.
May 2 '07 #8
Rabbit
12,516 Expert Mod 8TB
You could just set them to be invisible and then make them visible after.
May 2 '07 #9
ADezii
8,834 Expert 8TB
All,

After consulting with my supervisor we believe the option to duplicate the form with disabled object is the route we want to pursue. On that note I have created a copy of the form and have disabled everything except the Project_Name (Combo20) which the user will have the ability to select from a drop down. After the Update of this combo box I have the real form opening which I want to display all the pertinent information for the Project Name (Combo20) they had selected from the copied form (which I hope to be closing after the real form has been opened and has passed the Project Name variable to the real form). Can you help me pass the variable to the new form so the pertinent info is then displayed?

Here is my code from the After Update event of the Copy_Update_Custom_Code form.


Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo20_AfterUpdate()
  2. On Error GoTo Err_Combo20_AfterUpdate
  3.  
  4.     Dim stDocName As String
  5.     Dim stLinkCriteria As String
  6.  
  7.     stDocName = "Update_Custom_Code"
  8. '    DoCmd.Close
  9.     DoCmd.OpenForm stDocName, , , stLinkCriteria
  10.  
  11. Exit_Combo20_AfterUpdate:
  12.     Exit Sub
  13.  
  14. Err_Combo20_AfterUpdate:
  15.     MsgBox Err.Description
  16.     Resume Exit_Combo20_AfterUpdate
  17.  
  18. End Sub
  19.  

Here is the code I have behind my After Update event in the real Update_Custom_Code form. How do I pass the variable that was selected in the Copy_Update_Custom_Code form to this real Update_Custom_Code form? Note I do no have to close the Copy_Update_Custom_Code form, I can just hid it. Does that make it easier to pass the variable from one form to the other?

Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo20_AfterUpdate()
  2.     ' Find the record that matches the control.
  3.     Dim rs As Object
  4.  
  5.     Set rs = Me.Recordset.Clone
  6.     rs.FindFirst "[Project_Name] = '" & Me![Combo20] & "'"
  7.     If Not rs.EOF Then Me.Bookmark = rs.Bookmark
  8. End Sub
Try this on for size:
Expand|Select|Wrap|Line Numbers
  1. Dim stDocName As String
  2. Dim stLinkCriteria As String
  3.  
  4. stDocName = "Update_Custom_Code"
  5. stLinkCriteria = "[Project Name] ='" & Me![Combo20] & "'"
  6.  
  7. DoCmd.OpenForm stDocName, , , stLinkCriteria
  8. DoCmd.Close acForm, "Copy_Update_Custom_Code", acSaveNo
May 2 '07 #10
Birky
52
All,

Thank you very much for this is perfect when using a copy of the form (for input) and then passing the variable to the new form before closing. This is exactly what I was looking for. Although, they had changed some things on me and I believe I found a cleaner way to do the same thing with only one form. If I open the form in data input mode and disable all the objects except for the one I need to key off of. Once that object is populated I can then change the form to no data input and re-enable all the objects . This too works out well and has proven to be a supervisor pleaser.

Again thanks for all your help for you all had helped me think outside the box.

Birky
May 8 '07 #11
Hello,

I am trying to do exactly the same thing, however having a copy of the form is not an option. I am intrigued by rabbits idea of making the subform become visible only after a selection has been made in the project box (in my form it displays a list box).

Any help would be greatly appreciated.

Oxford
May 9 '07 #12

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

Similar topics

2
by: Chris | last post by:
I think I already know that the answer is that this can't be done, but I'll ask anyways. Suppose you want to use an RDBMS to store messages for a threaded message forum like usenet and then...
0
by: CSDunn | last post by:
Hello, I have a problem with field filtering between an Access 2000 Project form (the application is called CELDT), and the report that shows the results of the filter. Both the form and the...
3
by: Ranman | last post by:
Hi all, I have a simple problem that hopefully has a simple solution, but I have yet to figure it out. In a patient database, I have a physician test order form that populates a report that is...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
4
by: Keith | last post by:
Hello - this started out as a minor annoyance - and now is starting to bother me more and more - I'm hoping someone can help me. I would like to have a combobox display - NOT initially be blank...
8
by: fonzie | last post by:
Is it possible to have a data entry form where the information is stored in several different tables (5 or 6)? I have an inventory database where Table1 stores all of the data common to all...
1
by: Matik | last post by:
Hey, First, sorry if this post appear twice, because, I can not find my post recently send, trying to post it once again. I'm out of ideas, so, I thought, will search help here again :( I'm...
4
by: rszebras | last post by:
I inherited a database (as a novice at Access) and need to modify it to make it more efficient, i.e., the assignment form needs to autopopulate with the client's name, address, phone number, etc.,...
3
by: Andrew Robinson | last post by:
I have a Grid View and associated Object Data Source control. The ODS interface with a custom data source that returns a List<MyEntity>. I am only referencing some of the columns on the GridView....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.