• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 272
  • Last Modified:

Suform requerring a main froms txtbox urgent 500 points

i need to requery a txtbox on my main form when an entry is put into my sbform.

I have tried Forms!frmTimeEntry.txtOTime.Requery on an after update event dosnt work.

I cant requery the whole form due to a complex nature i will not get into.

Thanks
0
ellandrd
Asked:
ellandrd
  • 4
  • 2
1 Solution
 
jjafferrCommented:
Instead of Requerying the Textbox, why don't you just add the data directly to it from the subform, like this:
Forms![Main Form Name]![Field Name]= [Your Subform Field name]

usually you want to requery a combobox so that it reflects new data.

jaffer
0
 
jjafferrCommented:
You can also requery the Main Form and after you requery, you go back to the Record you were before (so the Form will not start from Record Number one),
you can use RecordsetColon.Bookmark
0
 
ellandrdAuthor Commented:
you second suggestion sounds best how do i go about that?

Never used it.

Ps there is a SQL trigger on the main txt boxes that why i am going down this route
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
jjafferrCommented:
shanesuebsahakarn wrote:

Dim ID As Long

ID=Forms!MyFourTableForm!txtID
Forms!MyFourTableForm.Requery
Forms!MyFourTableForm.RecordsetClone.FindFirst "[ID]=" & ID
Forms!MyFourTableForm.BookMark=Forms!MyFourTableForm.RecordsetClone.BookMark

This assumes that the four table form has a numeric ID field (called ID), held in a textbox called txtID. If the ID is a text field, you'd need code like this:
Dim ID As String

ID=Forms!MyFourTableForm!txtID
Forms!MyFourTableForm.Requery
Forms!MyFourTableForm.RecordsetClone.FindFirst "[ID]='" & ID & "'"
Forms!MyFourTableForm.BookMark=Forms!MyFourTableForm.RecordsetClone.BookMark


jaffer
0
 
ellandrdAuthor Commented:
thanks
0
 
jjafferrCommented:
you are welcome,
and thanks for the points and grade.

jaffer
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now