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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Creating ghost record and updating record 1

Status
Not open for further replies.

frankcpl

Technical User
Mar 16, 2007
77
0
0
US
I have run into a problem with a database I am working on. It is a simple log in and log out database. The way it works is a form creates a record for logging in. Then another for updates that record when you log out. The problem I have is that everything is working, except I get a record with log out edits, while the record is updated. I am trying to find a way to stop the ghosting of the record. I am using Access 2010, and would appreciate any help.
 
I think you need to re explain your issue so we can better understand with posted code

HTH << MaZeWorX >> "I have not failed I have only found ten thousand ways that don't work" <<Edison>>
 
I have 1 table and 1 query and 2 forms. I want 1 form to update have of the table and another form to update the rest of the table. Right now I have everything working properly, except the 2nd form. When it is used to update the table through the query, it creats another record that contains only the information that is inputed in that form. It also updates the record as well. I am using a combo box on the second form that uses the query to find a record and populates the form with the information. I am not for sure how to explain, but I can attach the database if anyone would like to look at it and see what I am trying to explain.
 
You can start by providing the fields in the table and the record sources of the two forms. When you state "have (half) of the table" what do you mean? Are you suggesting some fields are bound to controls in one form and other fields are bound to another form?

Are you attempting to edit the same record from two different forms at the same time?

Why two forms?

Duane
Hook'D on Access
MS Access MVP
 
I have a table that has 7 fields ID(key), Stud ID, Stu Name, Subject, Time In, Time Out, Date in. I have a query that pulls only records that have blank "time out" field. I have a sign in form, that creates a record with all the information except time out. Form two has a combo box that pulls the record, and a text box to fill in the time.
Yes fields are bound to 2 forms.

No, I have a Navigation Form that is opened each time a user checks in or checks out.

Why 2 forms, figured it would be the easiest way.

Thanks for helping me help ya'll understand what I am trying to accomplish.
 
sounds like your second form is bound to the table it adds the new record and your query updates the existing record.

HTH << MaZeWorX >> "I have not failed I have only found ten thousand ways that don't work" <<Edison>>
 
The second form record source is the table and has an unbound combo box. The search is done by the following code.

Dim rs As Object

Set rs = Me.Recordset

rs.FindFirst "[Student ID] = " & Me.Combo5
Me.Bookmark = rs.Bookmark

If [Time Out].Value <> " " Then

rs.FindNext "[Student ID] = " & Me.Combo5
Me.Bookmark = rs.Bookmark

MazeWorX -- I am lost on translating your statement. I thought you needed to bound your text boxes or the data would no be inputted anywhere. Can you elaborate a little?
 
I would create the second form with a subform to display the records for timeout. Place a combo box in the header of the second main form and set the Link Master/Child from the combo box to the field in the subform (no code involved). If you want to filter to records without a timeout value, you can change the record source of the subform to something like:
Code:
SELECT *
FROM tblYourTable
WHERE [Time Out] is Null
ORDER BY ...;
Do you really allow spaces in your time out field? Isn't this a date/time field? I can't see how this would ever work:
Code:
  If [Time Out].Value <> " " Then

Duane
Hook'D on Access
MS Access MVP
 
I see the confusion there. That last part was an weak attempt to find only the record in the table that matches the Combo box selection that has a null value. I have created a subform and that seems to be a solution for the issue at hand. Thanks for ya'lls input.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top