Name was temp code. We don't actually use it for production, it was just to demonstrate the code. I figured it out. Actually, my solution is really terrible, but I think it's how ms access works. Again, there is a combo box on the form to select the record or make a new record if the input value is not in the combo box.
1. This requires code and here is the code to return an id number:
Code:
Set rsQB = CurrentDb.OpenRecordset("public_bundles", dbOpenDynaset)
With rsQB
'Find first does not work with a table recordset, which is quite unbelievable. Also, combo boxes don't always have columns
.FindFirst "Name = """ + Name + """"
'By the by, if findfirst doesnt' find any, .eof is still false! The cursor stays on the first record.
If .NoMatch = True Then
'We're in luck, this code has already been made
.AddNew
![Name] = Name
'and then you have to update it. Sad but true
.Update
.Requery
.MoveFirst
'bookmark last modified doesn't work with postgre the way it works with sharepoint
.FindFirst "Name = """ + Name + """"
getIDFromName = .bundlesID
Else
getIDFromName = .bundlesID
End If
.Close
End With
The critical key here is if you need to make a new record, do not use .bookmark = .lastmodified nonsense because it will say the record has been deleted, probably because it's postgre. The right thing to do if you made a new record is to search for it. It takes more time, but that's how access was put together.
2. This kinda works
Code:
set clone = Me.recordsourceclone
with clone
.findfirst "Name = " + name <-with all the quotes bullcrap
form.bookmark = .bookmark
3. If you have a subreport, setting the parent and child fields to filter the subreport with the value from the parent does not work. You have to physically manipulate the recordsource of the child off of an event like this:
Code:
Me![Child16].Form.RecordSource = "you're favorite query"
Me![Child16].Form.Requery
4. This is the hardest part. The data underlying the combo box will be updated with the new value, but then the combo box will reset. So before doing step 3 above, its' best to properly setup the combo box
Code:
Me![Combo14].Requery
Me![Combo14].Value = Name
So do step 3 before 4.