Auto complete a form field on Open

Locopete99

Registered User.
Local time
Today, 12:43
Joined
Jul 11, 2016
Messages
163
Hi Guys,

I'm looking to autocomplete a field on opening of a form.

I want Blanket agreement number1 on Frms_Report to automatically be entered with the Blanket Agreement Number from Frm_Shikomi Register.

I'm using the below, but it isn't working.

Can you advise?

Code:
Private Sub Blanket_Agreement_Number_AfterUpdate()
Forms!Frm_reports.[Blanket_Agreement_number1] = Forms!Frm_Shikomiregister.[Blanket_Agreement_Number]
End Sub
 
Are both forms Open? Is the value available from a table somewhere or is it only available from the [Frm_Shikomiregister] form?
 
Both forms should be open.

To open the Frm_Reports you have to click on a button on Frm_ShikomiRegister.

The value is stored on tbl_ShikomiRegister.

I was using it from the form as I want Frm_reports to open with the same value that is currently being seen Frm_shikomiregister.

I dont want to go down the route of having to make a query to extract all the value from tbl_shikomiregister and amend the values on tbl_reports, as the only way I can think of doing this would delete all other saved information on tbl_reports
 
Thanks, this has solved that issue, but led to another.

If there is a record in Tbl_reports with a blanket agreement number, this is now opening that record and overwriting it with the new blanket agreement number.

Can I add in a line beforehand that says IF isnull (ME.Openargs) then add a new record and then have the Split OpenArgs follow this?
 
The link I provided is using an If...Else...End If structure.
 

Users who are viewing this thread

Back
Top Bottom