I have checked my code, cant see nothing wrong, still all I get is the main form filtering correctly but cant filter on the subform, it goes to a blank record and there defiantly is a related record id=9 for record id=45.
Ok So I now have this code :-
Dim namMain As String, namSub As String
Dim sfrm As Form, Criteria As String
namMain = "service customers"
namSub = "SR"
Criteria = "[ID] =45"
DoCmd.OpenForm namMain, , , Criteria
Set sfrm = Forms(namMain)(namSub).Form
sfrm.Filter = "[ID]...
Ok I have searched on the openArgs and think the code below should work though I do have a couple of quick question:-
Dim sfrm As Form, rst As DAO.Recordset, Idx As Integer
Dim idClient As Long, idDeal As Long
Set frm = Me!Deals.Form
Idx = InStr(1, Me.OpenArgs, ".")...
Thanks for the reply, however may be I am not making it clear, I am trying filter/select a record on the main form then select/filter a record on the subform.
On the main form I need to filter on [id] and also [id] in the subform which is a related table.
Suppose I want to write code to select...
Sorry should of read :-
Code is:-
Dim stLinkCriteria As String
stDocName = "service customers"
stLinkCriteria = "[ID]=" & Me![List0]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Qestion: How do use a AND condition in my stLinkCritera string so I can filter on field [id] on...
Ok this is the code I know how to use to open a form and filter on a field in the main part of the form:-
Dim stLinkCriteria As String
stDocName = "service customers"
DoCmd.OpenForm stDocName, , , stLinkCriteria
What I am having trouble with is trying to filter a related record in...
If I have two tables Table1 & Table2 with a one to many relation ships, create a form with Table1 and Table2 as subform. I now want to open this form from another form and select a record in the main form and a related record in the subform.
Could someone be kind enough to show me how with VBA...
Instr({somestring}, {character}) returns the postion of {character} in the string {string}
Is exactly what i was looking for so will give it a go, i couldnt find this in access anywaere builder help ect
Much appricated Jim
Regards
Does anyone know, how you can search for a character in a string like the Find function in Excel. I have a field Full Name that is first name and surname together; I need to strip out the first letter of the surname to sort on.
I have a simple select query that has no criteria, therefore shows all records, I want to use the left function to strip out the first letter of a field called “Full Name” which is the primary key of the table, however if I write Prefix: Left([Full Name],1) I get this error “The specified field...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.