Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple view in form

Status
Not open for further replies.

esu4edp

Technical User
Feb 15, 2000
59
US
Ok, this is what I want to happen. On a form, in single form view, I want to be able for the user to type in their information and when they are done, hit a button that will add/update the records. After that I want the records to be displayed in datasheet view on the same form. I know this may sound a little confusing, but I want to know if its possible and how to go about doing it.

I tried making 2 tables with the same fields in each. One was a temporary table and the other was the permanant table. I tried using an append, update query to move the temp table info to the perm table info, and then a delete query to delete the info out of the temp table. This didnt seem to work very well.
 
If that is really what you want to do then I would use a subform to display all of the records in the table while the current record is displayed in the main form.

When you have updated the currently displayed record clicked the SAVE button the VBA code behind the button would save and updated the table with new and edited data and then requery the Subform and refresh the form with the changes that were made. The subform would be a scrollable form where you could review the records after being updated.
The subform would look much like a DataSheet form.

Does this sound like what you want? Bob Scriver
 
Well, I'm pretty sure! You say in your first line "If that is really what I want to do", If you have a different approach I would love to hear it, cause I'm really struggling on a way to do what I want to make it easier on the user of the form.

I'll give you an example:

User will choose a section number of a criminal charge from a combo box. After they choose that a text box will auto-fill with the name of that charge (i.e. 321.56=Assault). After the charge they will pick if it was completed or attempted. Then they will pick if the person charged was under any influence (i.e. alcohol, drugs, etc.). What type of place were they at when the offense occured and so on. So their is alot of information to choose from each time a record is entered. Also there could be more that one charge. So I want the user to be able to see(in datasheet view) after they pick the charge and the info associated with it and save it. That way if there were 7 charges in this one case, they could see what charges they have picked in datasheet view, if figured it would be easier to see all the different records associated with this one case.

Hope this all makes scense
 
Okay, I understand what you are trying to do. I will make a suggestion to make this form be easy to use and provide the user all the information necessary for easy in entering all of the data.

You table will have all of the records for the table. Many different cases I assume. But, the user that is entering for this case would be interested in seeing only those records entered for this case. To start with there would be none. The main form would have the data for the current record being entered. The subform on the same screen would display all records for this particular case. If the user is just starting it would be blank with no records showing. But, as each record is entered it would start to display the already entered records.

Is that what you would like to see? Bob Scriver
 
Yes, exactly. On the form, I have tab controls. The fist is Admin(this has to do with date and time and location and the report number and so on. The next tab would be the offense info. So the two tables(TBL_Admin and TBL_Offense is connected by the report number). So when they go to the offense tab it should be blank for that report number, unless they are editing or updating an existing report.
 
This should be fairly easy. You need to create a new query of records with the criteria for the Report Number column being a reference to the value of the Report Number control on the form. Example:
Select *
FROM tblOffense
WHERE tblOffense.[Report Number] = Forms![frmYourForm]![Report Number]
ORDER BY tblOffense.[criminal charge];

This query will be used to populate the subform.

Next you need to create a form to be used in the subform to display the records. This should be a continuous form type(basicially a datasheet row format). The Record Source should be your newly created query.

Now we have to create a SubForm on a new tab on your form using the newly created continuous form. If you don't know how to do this read up on subforms in ACCESS Help and use your Wizard button to have ACCESS help you to create the form object. Get back to me if you have more questions on how to do this. I just don't know how proficient you are ACCESS so please advise. Bob Scriver
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top