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

1 Form 2 Uses

Status
Not open for further replies.

robcarr

Programmer
May 15, 2002
633
GB
Hi,

Access 2010, split database, multi user (no more than 10) at a time, they access through the front end, the database is saved as accde format

I have a user form which is used to log absence records at my place of work, the form can be accessed by clicking a button from the main form, or from clicking a specific existing absence from a popup form, I am having problems with the form loading and what it is displaying

if the form is loaded through the main form button and the inputter enters the name and then the system finds a record that matches (matched records are shown on a sub form) it will ask the user if they wish to edit am existing record, they click yes and they are able to edit the existing record from the list in the sub form - this seems to work fine,

frmabsencelogging - data entry yes, only filter is No, source is tblabsencelogging - all the records

if I try to click from a popup form the frmabsencelogging is blank

popup form click event

Code:
stdocna = "frmOpenCasesMainPagebyOPS"
stDocNa1 = "frmmainpage"
stDocNa2 = "frmAbsencelogging"
stlinkcriteria = "[SicknessReference] = " & Me![SicknessReference]
DoCmd.OpenForm stDocNa2, , , stlinkcriteria
DoCmd.Close acForm, stdocna
DoCmd.Close acForm, stDocNa1

I cant seem to get the 1 form to work with both uses well, any suggestions welcome








Hope this is of use, Rob.[yoda]
 
an auto generated number

Hope this is of use, Rob.[yoda]
 
So normally if it opens blank it is because it cannot find a record that matches. So debug it.

stlinkcriteria = "[SicknessReference] = " & Me![SicknessReference]
debug.print stLinkcriteria

now go to the immediate window and see what it shows. Likely for some reason it is not returning any reference number. Any chance that is the wrong name of the control.
 
robcarr said:
if I try to click from a popup form the frmabsencelogging is blank

Of course it is..you have the Data Entry Property set to Yes

robcarr said:
frmabsencelogging - data entry yes

which means that you can only enter New Records...you cannot view existing Records, so the Where clause is useless...there are no existing Records in the Recordset when a form is opened with this Property set to Yes.

My guess is that you've been mislead by the property name Data Entry; it doesn't have to be set to Yes in order to enter data...you just have to have AllowAdditions and/or AllowEdits set to Yes!

The Missinglinq

Richmond, Virginia

The Devil's in the Details!
 
majp - I checked that on the popup and it shows a record matching

missingling - I will check and see what happens, that seems to make sense



Hope this is of use, Rob.[yoda]
 
Missingling's solution should work. I did not see the data entry setting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top